feat(监控): 完善系统监控、登录状态与访问审计能力
This commit is contained in:
@@ -3,7 +3,7 @@ import { useAuthStore } from "../store/auth";
|
||||
import { useSessionStore } from "../store/session";
|
||||
import { isTauriRuntime } from "../runtime";
|
||||
import { getToken, setToken } from "../utils/auth";
|
||||
import { extendToken } from "../api/authClient";
|
||||
import { extendToken, logoutSession } from "../api/authClient";
|
||||
import { parseJwtExp } from "./jwt";
|
||||
|
||||
export const IDLE_TIMEOUT_MINUTES = 30;
|
||||
@@ -172,6 +172,10 @@ const performLogout = async (reason?: string) => {
|
||||
setLogoutReason(reason);
|
||||
const auth = useAuthStore();
|
||||
const session = useSessionStore();
|
||||
const token = getToken();
|
||||
if (token) {
|
||||
await logoutSession(token).catch(() => undefined);
|
||||
}
|
||||
const logoutPromise = auth.logout();
|
||||
session.resetActivity();
|
||||
router.replace("/login");
|
||||
|
||||
Reference in New Issue
Block a user