Bläddra i källkod

登录失效 & 主动退出

Michael Wang 4 år sedan
förälder
incheckning
30398edf06
2 ändrade filer med 4 tillägg och 2 borttagningar
  1. 1 1
      src/api/markPage.ts
  2. 3 1
      src/plugins/axiosNotice.ts

+ 1 - 1
src/api/markPage.ts

@@ -134,5 +134,5 @@ export async function changeUserInfo(name: string, password?: string) {
 
 /** 评卷用户退出 */
 export async function doLogout() {
-  return httpApp.post("/mark/logout");
+  window.location.href = "/mark/logout";
 }

+ 3 - 1
src/plugins/axiosNotice.ts

@@ -8,6 +8,8 @@ export const notifyInvalidTokenThrottled = throttle(() => {
     content: "登录失效,请重新登录!",
     duration: 10,
   });
-  doLogout();
+  setTimeout(() => {
+    doLogout();
+  }, 3000);
   console.log("登录失效");
 }, 1000);