瀏覽代碼

fix domain未保存的情况

Michael Wang 6 年之前
父節點
當前提交
20b4883ea0
共有 1 個文件被更改,包括 3 次插入3 次删除
  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();