fix: adapt frontend for legacy Chrome and runtime config

This commit is contained in:
fengxiangdebaozi committed 2026-07-11 16:55:08 +08:00
1 parent db2f21191c
commit 388a9133fc
84 files changed
+1186 -528

No files matched your search

+4
View File
@@ -22,6 +22,8 @@ import {
} from "@/core/auth/scoped-storage";
const AUTH_STORAGE_KEY = "deerflow.auth";
/** Fired in the current tab because the browser `storage` event only reaches other tabs. */
export const AUTH_STATE_CHANGED_EVENT = "deerflow:auth-state-changed";
function isBrowser(): boolean {
return typeof window !== "undefined";
@@ -48,6 +50,7 @@ export function setStoredAuth(auth: LoginByUsernameResponse) {
return;
}
authStorageSet(AUTH_STORAGE_KEY, JSON.stringify(auth));
window.dispatchEvent(new Event(AUTH_STATE_CHANGED_EVENT));
}
export function clearStoredAuth() {
@@ -55,6 +58,7 @@ export function clearStoredAuth() {
return;
}
authStorageRemove(AUTH_STORAGE_KEY);
window.dispatchEvent(new Event(AUTH_STATE_CHANGED_EVENT));
}
/** 与设置 → 个人信息页「用户名」一致:邮箱 @ 前缀,否则 user_id。 */