feat: 增加登录限流和跨进程退出机制
This commit is contained in:
@@ -496,9 +496,13 @@ async function login() {
|
||||
}
|
||||
}
|
||||
|
||||
function logout() {
|
||||
clearToken();
|
||||
admin.value = null;
|
||||
async function logout() {
|
||||
try {
|
||||
await api.logout();
|
||||
} finally {
|
||||
clearToken();
|
||||
admin.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function switchMenu(menu: string) {
|
||||
|
||||
@@ -84,6 +84,7 @@ export const api = {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ username, password }),
|
||||
}),
|
||||
logout: () => request<null>("/admin/logout", { method: "POST", body: "{}" }),
|
||||
profile: () => request<AdminProfile>("/admin/profile"),
|
||||
dashboard: (start?: string, end?: string) => {
|
||||
const params = new URLSearchParams();
|
||||
|
||||
Reference in New Issue
Block a user