diff --git a/src/permission.js b/src/permission.js index 6e10115a..7f070fe0 100644 --- a/src/permission.js +++ b/src/permission.js @@ -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}`) diff --git a/src/utils/request.js b/src/utils/request.js index 30548865..57031da1 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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: '系统提示',