Преглед изворни кода

Merge branch 'master' of http://192.168.0.115:3000/chenzimin2/ZGZQBWG

aamin пре 1 година
родитељ
комит
c3fd7936ea
2 измењених фајлова са 32 додато и 28 уклоњено
  1. 26 26
      game/public/unity/disaster-relief/ServiceWorker.js
  2. 6 2
      game/src/views/PairUp.vue

+ 26 - 26
game/public/unity/disaster-relief/ServiceWorker.js

@@ -1,33 +1,33 @@
-const cacheName = "4dage-RacingCar-0.1.0";
+const cacheName = "4dage-RacingCar-0.1.0"
 const contentToCache = [
-    "Build/Build.loader.js",
-    "Build/Build.framework.js.unityweb",
-    "Build/Build.data.unityweb",
-    "Build/Build.wasm.unityweb",
-    "TemplateData/style.css"
+  "Build/Build.loader.js",
+  "Build/Build.framework.js.unityweb",
+  "Build/Build.data.unityweb",
+  "Build/Build.wasm.unityweb",
+  "TemplateData/style.css"
 
-];
+]
 
 self.addEventListener('install', function (e) {
-    console.log('[Service Worker] Install');
-    
-    e.waitUntil((async function () {
-      const cache = await caches.open(cacheName);
-      console.log('[Service Worker] Caching all: app shell and content');
-      await cache.addAll(contentToCache);
-    })());
-});
+  console.log('[Service Worker] Install')
+
+  e.waitUntil((async function () {
+    const cache = await caches.open(cacheName)
+    console.log('[Service Worker] Caching all: app shell and content')
+    await cache.addAll(contentToCache)
+  })())
+})
 
 self.addEventListener('fetch', function (e) {
-    e.respondWith((async function () {
-      let response = await caches.match(e.request);
-      console.log(`[Service Worker] Fetching resource: ${e.request.url}`);
-      if (response) { return response; }
+  e.respondWith((async function () {
+    let response = await caches.match(e.request)
+    console.log(`[Service Worker] Fetching resource: ${e.request.url}`)
+    if (response) { return response }
 
-      response = await fetch(e.request);
-      const cache = await caches.open(cacheName);
-      console.log(`[Service Worker] Caching new resource: ${e.request.url}`);
-      cache.put(e.request, response.clone());
-      return response;
-    })());
-});
+    response = await fetch(e.request)
+    const cache = await caches.open(cacheName)
+    console.log(`[Service Worker] Caching new resource: ${e.request.url}`)
+    // cache.put(e.request, response.clone())
+    return response
+  })())
+})

+ 6 - 2
game/src/views/PairUp.vue

@@ -253,8 +253,14 @@ const logoFileNameList = [
   '中证数据有限责任公司.png',
   '朱雀基金管理有限公司.png',
 ]
+
+const activeCardIdxList = ref([])
+const activeCardIdxListRealTime = ref([])
 const cardList = ref([])
+
 function setCardList() {
+  activeCardIdxList.value = []
+  activeCardIdxListRealTime.value = []
   cardList.value = []
   nextTick(() => {
     for (let index = 0; index < 8; index++) {
@@ -275,8 +281,6 @@ function setCardList() {
 }
 setCardList()
 
-const activeCardIdxList = ref([])
-const activeCardIdxListRealTime = ref([])
 function onClickCard(card, cardIdx) {
   if (activeCardIdxList.value.includes(cardIdx)) {
     return