Expand seller store functionality

This commit is contained in:
R524809
2026-09-07 17:51:11 +08:00
parent 4c0f3a4a79
commit ceb644a3f9
35 changed files with 32883 additions and 364 deletions
+6 -3
View File
@@ -1,16 +1,19 @@
/**
* access token 仅在内存中短暂持有(docs/api/conventions.md §1),
* 不得写入 localStorage 等持久化存储;页面刷新后由 /auth/refresh 通过
* HttpOnly cookie 恢复会话(接入会话恢复逻辑时实现)。
* 正常 Web 调用仍只从内存读取 token。为自托管采集插件互操作,维护者
* 明确批准将当前短期 token 镜像到本站 localStorage;见
* docs/project/extension-login-alternatives.md,不得扩大到其他调用方。
*/
let accessToken: string | null = null;
export const extensionWebAccessStorageKey = 'atlas.extension.web-access';
export const authToken = {
get: () => accessToken,
set: (token: string) => {
accessToken = token;
localStorage.setItem(extensionWebAccessStorageKey, JSON.stringify({ accessToken: token }));
},
clear: () => {
accessToken = null;
localStorage.removeItem(extensionWebAccessStorageKey);
},
};