liuminjian преди 3 години
родител
ревизия
a2af02c6f8
променени са 2 файла, в които са добавени 10 реда и са изтрити 3 реда
  1. +10
    -2
      src/permission.js
  2. +0
    -1
      src/utils/request.js

+ 10
- 2
src/permission.js Целия файл

@@ -57,7 +57,13 @@ router.beforeEach((to, from, next) => {
}).catch(err => { }).catch(err => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
// Message.error(err) // 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 { } else {
@@ -70,7 +76,9 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入 // 在免登录白名单,直接进入
next() next()
} else { } 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}`) next(`/homestead/login?redirect=${to.fullPath}`)
} else { } else {
next(`/login?redirect=${to.fullPath}`) next(`/login?redirect=${to.fullPath}`)


+ 0
- 1
src/utils/request.js Целия файл

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


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


Зареждане…
Отказ
Запис