|
@@ -4,21 +4,25 @@ import { message } from "ant-design-vue";
|
|
|
import { logout } from "@/api/loginPage";
|
|
|
import router, { routeLogout } from "@/router";
|
|
|
|
|
|
-export const notifyInvalidTokenThrottled = throttle(() => {
|
|
|
- if (router.currentRoute.value.name === "Login") {
|
|
|
- return;
|
|
|
- }
|
|
|
- message.error({
|
|
|
- content: "登录失效,请重新登录!",
|
|
|
- duration: 10,
|
|
|
- });
|
|
|
- setTimeout(() => {
|
|
|
- logout().finally(() =>
|
|
|
- routeLogout({
|
|
|
- cause: "登录失效",
|
|
|
- redirectTo: router.currentRoute.value.fullPath,
|
|
|
- })
|
|
|
- );
|
|
|
- }, 3000);
|
|
|
- console.log("登录失效");
|
|
|
-}, 5000);
|
|
|
+export const notifyInvalidTokenThrottled = throttle(
|
|
|
+ () => {
|
|
|
+ if (router.currentRoute.value.name === "Login") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ message.error({
|
|
|
+ content: "登录失效,请重新登录!",
|
|
|
+ duration: 10,
|
|
|
+ });
|
|
|
+ setTimeout(() => {
|
|
|
+ logout().finally(() =>
|
|
|
+ routeLogout({
|
|
|
+ cause: "登录失效",
|
|
|
+ redirectTo: router.currentRoute.value.fullPath,
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }, 3000);
|
|
|
+ console.log("登录失效");
|
|
|
+ },
|
|
|
+ 5000,
|
|
|
+ { trailing: false }
|
|
|
+);
|