feat(监控): 完善系统监控、登录状态与访问审计能力
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled

This commit is contained in:
Cheng Zhou
2026-07-10 17:11:24 +08:00
parent 400c9be3a7
commit f11a5c84d9
82 changed files with 10283 additions and 1781 deletions
+19
View File
@@ -33,6 +33,11 @@ export type LoginKeyResponse = {
expires_at: string;
};
export type SessionHeartbeatResponse = {
status: "online";
last_seen_at: string;
};
export type EncryptedPasswordRequest = {
key_id: string;
challenge: string;
@@ -53,4 +58,18 @@ export const extendToken = (token: string): Promise<AxiosResponse<ExtendResponse
export const getLoginKey = (): Promise<AxiosResponse<LoginKeyResponse>> =>
authClient.get<LoginKeyResponse>("/api/v1/auth/login-key");
export const heartbeatSession = (token: string): Promise<AxiosResponse<SessionHeartbeatResponse>> =>
authClient.post<SessionHeartbeatResponse>(
"/api/v1/auth/session/heartbeat",
{},
{ headers: { Authorization: `Bearer ${token}` }, timeout: 5000 },
);
export const logoutSession = (token: string): Promise<AxiosResponse<void>> =>
authClient.post<void>(
"/api/v1/auth/session/logout",
{},
{ headers: { Authorization: `Bearer ${token}` } },
);
export default authClient;