修改禅道已知问题

This commit is contained in:
qq787203167
2022-03-10 19:13:11 +08:00
parent 7fcd61cbfd
commit ca0e81a9c0
7 changed files with 293 additions and 178 deletions
+29 -7
View File
@@ -72,14 +72,36 @@ const err = (error) => {
notification.error({ message: '系统提示', description: '网络超时' })
break
case 401:
notification.error({ message: '系统提示', description: '未授权请重新登录', duration: 4 })
if (token) {
store.dispatch('Logout').then(() => {
setTimeout(() => {
window.location.reload()
}, 1500)
if (token && data.message.includes('Token失效')) {
Modal.error({
title: '登录已过期',
content: '很抱歉登录已过期请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
try {
let path = window.document.location.pathname
console.log('location pathname -> ' + path)
if (path != '/' && path.indexOf('/user/login') == -1) {
window.location.reload()
}
} catch (e) {
window.location.reload()
}
})
}
})
}
// notification.error({ message: '系统提示', description: '未授权,请重新登录', duration: 4 })
// if (token) {
// store.dispatch('Logout').then(() => {
// setTimeout(() => {
// window.location.reload()
// }, 1500)
// })
// }
break
default:
notification.error({
@@ -121,7 +143,7 @@ service.interceptors.request.use(config => {
...config.params
}
}
} else if((config.method == 'post')) {
} else if ((config.method == 'post')) {
config.data = {
cut: cut,
...config.data