|
@@ -1,14 +1,17 @@
|
|
|
-import { store } from "@/store/store";
|
|
|
import { throttle } from "lodash-es";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+const router = useRouter();
|
|
|
|
|
|
export const notifyInvalidTokenThrottled = throttle(
|
|
|
() => {
|
|
|
$message.error("登录失效,请重新登录!");
|
|
|
- setTimeout(() => {
|
|
|
- store.user.token = null;
|
|
|
- }, 3000);
|
|
|
- logger({ pgu: "AUTO", cnl: ["console", "server"], dtl: "登录失效" });
|
|
|
+ logger({
|
|
|
+ pgu: "AUTO",
|
|
|
+ cnl: ["console", "server"],
|
|
|
+ dtl: "登录失效,请重新登录",
|
|
|
+ });
|
|
|
+ void router.push({ name: "UserLogin" });
|
|
|
},
|
|
|
- 1000,
|
|
|
+ 3000,
|
|
|
{ trailing: false }
|
|
|
);
|