diff --git a/ant-design-vue-jeecg/src/utils/request.js b/ant-design-vue-jeecg/src/utils/request.js index d4bcb60..d3b7009 100644 --- a/ant-design-vue-jeecg/src/utils/request.js +++ b/ant-design-vue-jeecg/src/utils/request.js @@ -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) {