|
|
|
@ -75,6 +75,14 @@ request.interceptors.response.use(async (response, options) => {
|
|
|
|
await freshTokenUsingPost(param).then((res) => {
|
|
|
|
await freshTokenUsingPost(param).then((res) => {
|
|
|
|
if (res.retcode) {
|
|
|
|
if (res.retcode) {
|
|
|
|
localStorage.setItem('token', res.data?.accessToken);
|
|
|
|
localStorage.setItem('token', res.data?.accessToken);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
localStorage.clear();
|
|
|
|
|
|
|
|
history.replace({
|
|
|
|
|
|
|
|
pathname: '/user/login',
|
|
|
|
|
|
|
|
search: stringify({
|
|
|
|
|
|
|
|
redirect: window.location.href,
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const url = response.url.replace(`${process.env.BASE_URL}`, '');
|
|
|
|
const url = response.url.replace(`${process.env.BASE_URL}`, '');
|
|
|
|
@ -122,6 +130,14 @@ request.interceptors.response.use(async (response, options) => {
|
|
|
|
await freshTokenUsingPost(param).then((res) => {
|
|
|
|
await freshTokenUsingPost(param).then((res) => {
|
|
|
|
if (res.retcode) {
|
|
|
|
if (res.retcode) {
|
|
|
|
localStorage.setItem('token', res.data?.accessToken);
|
|
|
|
localStorage.setItem('token', res.data?.accessToken);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
localStorage.clear();
|
|
|
|
|
|
|
|
history.replace({
|
|
|
|
|
|
|
|
pathname: '/user/login',
|
|
|
|
|
|
|
|
search: stringify({
|
|
|
|
|
|
|
|
redirect: window.location.href,
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const url = response.url.replace(`${process.env.BASE_URL}`, '');
|
|
|
|
const url = response.url.replace(`${process.env.BASE_URL}`, '');
|
|
|
|
|