Explorar o código

修改看板跳转问题

11wqe1 hai 14 horas
pai
achega
0a270001e2
Modificáronse 1 ficheiros con 5 adicións e 11 borrados
  1. 5 11
      src/permission.js

+ 5 - 11
src/permission.js

@@ -12,21 +12,15 @@ router.beforeEach(async (to, from, next) => {
   NProgress.start()
 
   const hasToken = store.getters.token
-  let loginType = window.topU ? window.topU.U.UF.Cookie.get("cocoroboLoginType") : window.top.U.UF.Cookie.get("cocoroboLoginType");
-  let cocorobo = window.topU ? window.topU.U.UF.Cookie.get("cocorobo") : window.top.U.UF.Cookie.get("cocorobo");
+  let loginType = window.topU ? window.topU.U.UF.Cookie.get("cocoroboLoginType") : window.top.U ? window.top.U.UF.Cookie.get("cocoroboLoginType") : '';
+  let cocorobo = window.topU ? window.topU.U.UF.Cookie.get("cocorobo") : window.top.U ? window.top.U.UF.Cookie.get("cocorobo") : '';
   if (hasToken && cocorobo && loginType != 1) {
     if (to.path === '/login') {
       console.log('111111111111');
       const userinfo = store.getters.userinfo && Object.keys(store.getters.userinfo).length > 0
-      console.log(userinfo);
-      
-      if (whiteList.indexOf(to.path) !== -1) {
-        // 在免登录白名单中,直接进入
-        next()
-      }else{
-        // 如果已登录,重定向到主页
-        next({ path: '/' })
-      }
+      console.log(userinfo);   
+      // 如果已登录,重定向到主页
+      next({ path: '/' })
       NProgress.done()
     } else {
       const userinfo = store.getters.userinfo && Object.keys(store.getters.userinfo).length > 0