Selaa lähdekoodia

Merge branch 'startLogin' into online

mo 1 vuosi sitten
vanhempi
commit
7ed620829f

+ 1 - 4
dev-dist/registerSW.js

@@ -1,5 +1,2 @@
 if ('serviceWorker' in navigator)
-  navigator.serviceWorker.register(`/dev-sw.js?dev-sw${new Date().getTime()}`, {
-    scope: '/',
-    type: 'classic'
-  });
+  navigator.serviceWorker.register('/dev-sw.js?dev-sw');

+ 44 - 34
dev-dist/sw.js

@@ -20,23 +20,21 @@ if (!self.define) {
   let nextDefineUri;
 
   const singleRequire = (uri, parentUri) => {
-    uri = new URL(uri + ".js", parentUri).href;
-    return registry[uri] || (
-      
-        new Promise(resolve => {
-          if ("document" in self) {
-            const script = document.createElement("script");
-            script.src = uri;
-            script.onload = resolve;
-            document.head.appendChild(script);
-          } else {
-            nextDefineUri = uri;
-            importScripts(uri);
-            resolve();
-          }
-        })
-      
-      .then(() => {
+    uri = new URL(uri + '.js', parentUri).href;
+    return (
+      registry[uri] ||
+      new Promise(resolve => {
+        if ('document' in self) {
+          const script = document.createElement('script');
+          script.src = uri;
+          script.onload = resolve;
+          document.head.appendChild(script);
+        } else {
+          nextDefineUri = uri;
+          importScripts(uri);
+          resolve();
+        }
+      }).then(() => {
         let promise = registry[uri];
         if (!promise) {
           throw new Error(`Module ${uri} didn’t register its module`);
@@ -47,7 +45,10 @@ if (!self.define) {
   };
 
   self.define = (depsNames, factory) => {
-    const uri = nextDefineUri || ("document" in self ? document.currentScript.src : "") || location.href;
+    const uri =
+      nextDefineUri ||
+      ('document' in self ? document.currentScript.src : '') ||
+      location.href;
     if (registry[uri]) {
       // Module is already loading or loaded.
       return;
@@ -59,15 +60,16 @@ if (!self.define) {
       exports,
       require
     };
-    registry[uri] = Promise.all(depsNames.map(
-      depName => specialDeps[depName] || require(depName)
-    )).then(deps => {
+    registry[uri] = Promise.all(
+      depsNames.map(depName => specialDeps[depName] || require(depName))
+    ).then(deps => {
       factory(...deps);
       return exports;
     });
   };
 }
-define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
+define(['./workbox-5357ef54'], function (workbox) {
+  'use strict';
 
   self.skipWaiting();
   workbox.clientsClaim();
@@ -77,16 +79,24 @@ define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
    * requests for URLs in the manifest.
    * See https://goo.gl/S9QRab
    */
-  workbox.precacheAndRoute([{
-    "url": "registerSW.js",
-    "revision": "6137f3202e711e407da62c90631d3729"
-  }, {
-    "url": "index.html",
-    "revision": "0.78n63d427ro"
-  }], {});
+  workbox.precacheAndRoute(
+    [
+      {
+        url: 'registerSW.js',
+        revision: '2ef9ea5f8ce5b3efb031d9c53700e57a'
+      },
+      {
+        url: 'index.html',
+        revision: '0.f2qovfbkdhg'
+      }
+    ],
+    {}
+  );
   workbox.cleanupOutdatedCaches();
-  workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
-    allowlist: [/^\/$/]
-  }));
-
-}));
+  workbox.strategies = 'NetworkOnly';
+  workbox.registerRoute(
+    new workbox.NavigationRoute(workbox.createHandlerBoundToURL('index.html'), {
+      allowlist: [/^\/$/]
+    })
+  );
+});

+ 1 - 1
src/components/RouterError/index.tsx

@@ -11,7 +11,7 @@ export default defineComponent({
     router.onError(error => {
       const str = error.message + '';
       const isChunkLoadFailed = str.indexOf('imported');
-
+      console.log(error)
       // const targetPath = router.history.pending.fullPath
       if (isChunkLoadFailed != -1 && !isOpen) {
         isOpen = true;

+ 1 - 1
src/components/layout/layoutTop.tsx

@@ -82,7 +82,7 @@ export default defineComponent({
               previewDisabled></NImage>
             <p>
               {/* {info.value.schoolInfos[0].tenantName} |{' '} */}
-              {info.value.schoolInfos[0].name}
+              {info.value?.schoolInfos[0]?.name || ''}
             </p>
           </div>
           <div class={styles.layoutRight}>

+ 2 - 1
src/custom-plugins/guide-page/myResources-guide.tsx

@@ -69,6 +69,7 @@ export default defineComponent({
         }else{
           guideInfo.value = {}
         }
+        console.log(guideInfo.value,'guideInfo.value')
         if (guideInfo.value && guideInfo.value.myResourcesGuide) {
           tipShow.value = false;
         } else {
@@ -133,7 +134,7 @@ export default defineComponent({
     const endGuide = async() => {
       // let guideInfo =
       //   JSON.parse(localStorage.getItem('teacher-guideInfo') || '{}') || null;
-      if (guideInfo.value) {
+      if (!guideInfo.value) {
         guideInfo.value = { myResourcesGuide: true };
       } else {
         guideInfo.value.myResourcesGuide = true;

+ 1 - 1
src/router/routes/index.ts

@@ -21,7 +21,7 @@ export const constantRoutes: RouteRecordRaw[] = [
         name: 'Home',
         component: () => import('@/views/home/index'),
         meta: {
-          title: '页',
+          title: '页',
           singleLayout: 'blank'
         }
       },

+ 0 - 1
src/views/home/index.tsx

@@ -820,7 +820,6 @@ export default defineComponent({
               // 密码更新成功
               showUpdatePassword.value = true;
               forms.showGuide = true;
-
               userStore.logout().then(() => {
                 // 移除标签页
                 router

+ 5 - 4
src/views/login/components/pwdLogin.tsx

@@ -78,11 +78,12 @@ export default defineComponent({
 
             // route.query?.redirect ||
             const toPath = decodeURIComponent('/' as string);
-
+            console.log(toPath,'toPath')
             message.success('登录成功,即将进入系统');
-            if (route.name === LOGIN_NAME) {
-              router.replace('/');
-            } else router.replace(toPath);
+            router.replace(toPath)
+            // if (route.name === LOGIN_NAME) {
+            //   router.replace('/');
+            // } else router.replace(toPath);
           } catch (e: any) {
             console.log(e, 'e');
           } finally {