Explorar el Código

登录失效 & 主动退出

Michael Wang hace 4 años
padre
commit
30398edf06
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  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);