Explorar o código

fix domain未保存的情况

Michael Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
20b4883ea0
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/router.js

+ 3 - 3
src/router.js

@@ -86,10 +86,10 @@ router.beforeEach((to, from, next) => {
   if (to.path.match(/^\/login\/.+$/)) {
     next();
   } else {
+    if (!localStorage.getItem("domain")) {
+      alert("地址出错,找不到机构!请关闭应用后重试!");
+    }
     if (!window.sessionStorage.getItem("token")) {
-      if (!localStorage.getItem("domain")) {
-        alert("地址出错,找不到机构!请关闭应用后重试!");
-      }
       next({ path: loginPath });
     } else {
       next();