解决token失效 ,登录页面重复跳转登录页面问题

dev
zhangdaiscott 5 years ago
parent b13a4b01df
commit 416c8df729

@ -32,13 +32,9 @@ const err = (error) => {
notification.error({ message: '', description: '访',duration: 4})
break
case 500:
let path = window.location.href
//notification.error({ message: '系统提示', description:'Token失效请重新登录!',duration: 4})
if(token && data.message.includes("Token失效") && path.indexOf('/user/login') < 0){
if(token && data.message.includes("Token失效")){
// update-begin- --- author:scott ------ date:20190225 ---- for:Token失效采用弹框模式不直接跳转----
// store.dispatch('Logout').then(() => {
// window.location.reload()
// })
Modal.error({
title: '',
content: '',
@ -48,7 +44,9 @@ const err = (error) => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
try {
if(path.indexOf('/user/login')==-1){
let path = window.document.location.pathname
console.log("location pathname -> "+path)
if(path!="/" && path.indexOf('/user/login')==-1){
window.location.reload()
}
}catch (e) {

Loading…
Cancel
Save