|
|
@@ -102,8 +102,8 @@ axios.interceptors.request.use(async (config) => {
|
|
|
// 如果已经在登录页且已有 redirect 参数,避免递归叠加
|
|
|
const isLogin = current?.name === RouteName.login;
|
|
|
const existing = (current?.query?.redirect as string | undefined);
|
|
|
- if (isLogin && existing) {
|
|
|
- return existing;
|
|
|
+ if (isLogin) {
|
|
|
+ return existing || "";
|
|
|
}
|
|
|
} catch {}
|
|
|
const { origin, pathname, search, hash } = window.location;
|
|
|
@@ -176,8 +176,8 @@ const responseInterceptor = (res: AxiosResponse<any, any>) => {
|
|
|
const current = router.currentRoute?.value;
|
|
|
const isLogin = current?.name === RouteName.login;
|
|
|
const existing = (current?.query?.redirect as string | undefined);
|
|
|
- if (isLogin && existing) {
|
|
|
- return existing;
|
|
|
+ if (isLogin) {
|
|
|
+ return existing || "";
|
|
|
}
|
|
|
} catch {}
|
|
|
const { origin, pathname, search, hash } = window.location;
|