zhanghao 5 月之前
父节点
当前提交
8afb191278
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 3 3
      src/permission.js
  2. 1 1
      src/utils/auth.js

+ 3 - 3
src/permission.js

@@ -8,7 +8,7 @@ import { isRelogin } from '@/utils/request'
 
 NProgress.configure({ showSpinner: false })
 
-const whiteList = ['/login', '/auth-redirect', '/bind', '/register','/screen','/pad','/index']
+const whiteList = ['/login', '/auth-redirect', '/bind', '/register','/screen','/pad']
 
 router.beforeEach((to, from, next) => {
   NProgress.start()
@@ -16,7 +16,7 @@ router.beforeEach((to, from, next) => {
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
     /* has token*/
     if (to.path === '/login') {
-      next({ path: '/' })
+      next({ path: '/index' })
       NProgress.done()
     } else {
       if (store.getters.roles.length === 0) {
@@ -32,7 +32,7 @@ router.beforeEach((to, from, next) => {
         }).catch(err => {
           store.dispatch('LogOut').then(() => {
             Message.error(err)
-            next({ path: '/' })
+            next({ path: '/login' })
           })
         })
       } else {

+ 1 - 1
src/utils/auth.js

@@ -1,6 +1,6 @@
 import Cookies from 'js-cookie'
 
-const TokenKey = 'Admin-Token'
+const TokenKey = 'Authorization'
 
 export function getToken() {
   return Cookies.get(TokenKey)