提交 6f001a77 编写于 作者: H haoxr

refactor: 代码优化

Former-commit-id: e7fb4e92
上级 614de534
......@@ -34,7 +34,7 @@ export const filterAsyncRoutes = (
} else {
const component = modules[`../../views/${tmp.component}.vue`] as any;
if (component) {
tmp.component = modules[`../../views/${tmp.component}.vue`];
tmp.component = component;
} else {
tmp.component = modules[`../../views/error-page/404.vue`];
}
......
......@@ -49,11 +49,12 @@ service.interceptors.response.use(
}
},
(error: any) => {
console.log('errorinfo', error.response.data);
if (error.response.data) {
const { code, msg } = error.response.data;
// token 过期,重新登录
if (code === 'A0230') {
ElMessageBox.confirm('当前页面已失效,请重新登录', 'Warning', {
ElMessageBox.confirm('当前页面已失效,请重新登录', '提示', {
confirmButtonText: 'OK',
type: 'warning'
}).then(() => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册