|
|
@@ -61,18 +61,19 @@ 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: '系统提示', |
|
|
|
message: '登录状态已过期,您可以继续留在该页面,或者重新登录', |
|
|
|
confirmButtonText: '重新登录', |
|
|
|
cancelButtonText: '取消' |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
store.dispatch('LogOut').then(() => { |
|
|
|
location.href = '/index'; |
|
|
|
}) |
|
|
|
}) |
|
|
|
// Dialog.confirm({ |
|
|
|
// title: '系统提示', |
|
|
|
// message: '登录状态已过期,您可以继续留在该页面,或者重新登录', |
|
|
|
// confirmButtonText: '重新登录', |
|
|
|
// cancelButtonText: '取消' |
|
|
|
// }) |
|
|
|
// .then(() => { |
|
|
|
// store.dispatch('LogOut').then(() => { |
|
|
|
// location.href = '/index'; |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
} else if (code === 500) { |
|
|
|
Dialog.alert({ type: 'warning', message: msg }); |
|
|
|
return Promise.reject(new Error(msg)) |
|
|
|