liuminjian před 3 roky
rodič
revize
a2af02c6f8
2 změnil soubory, kde provedl 10 přidání a 3 odebrání
  1. +10
    -2
      src/permission.js
  2. +0
    -1
      src/utils/request.js

+ 10
- 2
src/permission.js Zobrazit soubor

@@ -57,7 +57,13 @@ router.beforeEach((to, from, next) => {
}).catch(err => {
store.dispatch('LogOut').then(() => {
// Message.error(err)
next({ path: '/' })
if ('/authenticRight/index'.indexOf(to.path) !== -1) {
next({ path: '/authenticRight/login' })
} else if ('/homestead/index'.indexOf(to.path) !== -1) {
next({ path: '/homestead/login' })
} else {
next({ path: '/' })
}
})
})
} else {
@@ -70,7 +76,9 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入
next()
} else {
if ('/homestead/index'.indexOf(to.path) !== -1) {
if ('/authenticRight/index'.indexOf(to.path) !== -1) {
next(`/authenticRight/login?redirect=${to.fullPath}`)
} else if ('/homestead/index'.indexOf(to.path) !== -1) {
next(`/homestead/login?redirect=${to.fullPath}`)
} else {
next(`/login?redirect=${to.fullPath}`)


+ 0
- 1
src/utils/request.js Zobrazit soubor

@@ -61,7 +61,6 @@ service.interceptors.response.use(res => {
// 获取错误信息
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
console.log(this.$route.path)

Dialog.confirm({
title: '系统提示',


Načítá se…
Zrušit
Uložit