dedsudiyu 1 년 전
부모
커밋
c6435827a5
2개의 변경된 파일6개의 추가작업 그리고 7개의 파일을 삭제
  1. 6 6
      src/permission.js
  2. 0 1
      src/utils/request.js

+ 6 - 6
src/permission.js

@@ -22,29 +22,29 @@ router.beforeEach((to, from, next) => {
         // 判断当前用户是否已拉取完user_info信息
         store.dispatch('GetInfo').then(() => {
           store.dispatch('GenerateRoutes').then(accessRoutes => {
-            console.log('to',to);
+            console.log('to', to)
             // 根据roles权限生成可访问的路由表
             router.addRoutes(accessRoutes) // 动态添加可访问路由表
             next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
           })
         }).catch(err => {
-            store.dispatch('LogOut').then(() => {
-              Message.error(err)
-            })
+          store.dispatch('LogOut').then(() => {
+            Message.error(err)
           })
+        })
       } else {
         next()
       }
     }
   } else {
-    if(to.path == '/codeHtml' || to.path === '/bigDataLogin'){
+    if (to.path == '/codeHtml' || to.path === '/bigDataLogin') {
       next()
       return
     }
     // 没有token
     if (whiteList.indexOf(to.path) !== -1) {
       // 在免登录白名单,直接进入
-      console.log('在免登录白名单');
+      console.log('在免登录白名单')
       next()
     } else {
       console.log('没啦没啦')

+ 0 - 1
src/utils/request.js

@@ -82,7 +82,6 @@ service.interceptors.response.use(res => {
     //   // window.location.href = 'https://icas.jnu.edu.cn/cas/login?service=http://localhost:8081/#/login';
     //   return
     // }
-    debugger
     if(res.config.url == '/auth/logout'&&res.request.responseURL){
       window.location.href = res.request.responseURL;
       return