Michael Wang 6 лет назад
Родитель
Сommit
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();