dev-v2
Joe 2 months ago
parent 2295f9ffbf
commit a6ecd39422

@ -75,6 +75,14 @@ request.interceptors.response.use(async (response, options) => {
await freshTokenUsingPost(param).then((res) => {
if (res.retcode) {
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}`, '');
@ -122,6 +130,14 @@ request.interceptors.response.use(async (response, options) => {
await freshTokenUsingPost(param).then((res) => {
if (res.retcode) {
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}`, '');

Loading…
Cancel
Save