update @token失效调整
This commit is contained in:
parent
7ce35e0f79
commit
b7763da877
|
@ -10,20 +10,20 @@ function openDialog({ text, confirmTxt }:{ text: string, confirmTxt: string }) {
|
|||
unmount();
|
||||
resolve();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 创建一个挂载容器
|
||||
const parentNode = document.createElement('div')
|
||||
document.body.appendChild(parentNode)
|
||||
const parentNode = document.createElement('div');
|
||||
document.body.appendChild(parentNode);
|
||||
|
||||
// 卸载组件
|
||||
const unmount = () => {
|
||||
app.unmount()
|
||||
document.body.removeChild(parentNode)
|
||||
}
|
||||
app.unmount();
|
||||
document.body.removeChild(parentNode);
|
||||
};
|
||||
|
||||
// 挂载组件
|
||||
app.mount(parentNode)
|
||||
app.mount(parentNode);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import axios from "axios";
|
|||
import env from "@/utils/request/env";
|
||||
import { ResultEnum, ContentTypeEnum } from "./httpEnum";
|
||||
import openDialog from "@/components/base-dialog/dialog";
|
||||
import { getQueryParams } from "@/utils/methods";
|
||||
|
||||
interface axiosConfig {
|
||||
successMessage?: boolean;
|
||||
|
@ -49,12 +50,12 @@ service.interceptors.response.use(
|
|||
(err) => {
|
||||
console.log('---err---', err);
|
||||
if (err?.response?.status === 401 || err?.response?.code === 4001) {
|
||||
return openDialog({
|
||||
openDialog({
|
||||
text: '登录过期',
|
||||
confirmTxt: '重新进入'
|
||||
confirmTxt: '重新进入',
|
||||
})
|
||||
.then(() => {
|
||||
location.replace(`${location.origin}/yxh5/home?loginBack=${location.href}`);
|
||||
location.replace(`${location.origin}/yxh5/home?loginBack=${getQueryParams('loginBack') || location.href}`);
|
||||
})
|
||||
}
|
||||
return {};
|
||||
|
|
Loading…
Reference in New Issue