|
@@ -64,9 +64,12 @@ const postFile = (url: string, data: Record<string, any>) => {
|
|
|
|
|
|
const login = (isBack = true) => {
|
|
|
if (import.meta.env.VITE_LOGIN_VIEW) {
|
|
|
+ const curUrl = new URL(location.href)
|
|
|
+ curUrl.searchParams.delete('token')
|
|
|
+
|
|
|
const link = isBack
|
|
|
? tempStrFill(import.meta.env.VITE_LOGIN_VIEW, {
|
|
|
- redirect: escape(location.href),
|
|
|
+ redirect: escape(curUrl.toString()),
|
|
|
})
|
|
|
: import.meta.env.VITE_LOGIN_VIEW;
|
|
|
const url = new URL(link)
|
|
@@ -79,7 +82,7 @@ const login = (isBack = true) => {
|
|
|
|
|
|
const after = async (fet: Promise<Response>) => {
|
|
|
const res = await fet.then((res) => res.json());
|
|
|
- if (res.code === 4008) {
|
|
|
+ if ([4008, 4010].includes(res.code)) {
|
|
|
setTimeout(() => {
|
|
|
login();
|
|
|
}, 1000);
|