From a4c7adb3174488a3ec64a4c9dee07c738b059447 Mon Sep 17 00:00:00 2001 From: bestlee Date: Mon, 31 Aug 2026 17:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ai=5Ftoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/auth/index.ts | 1 + src/typings/api/auth.d.ts | 1 + src/typings/storage.d.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index 989b3f5..31c4432 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -131,6 +131,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { async function loginByToken(loginToken: Api.Auth.LoginToken) { // 1. stored in the localStorage, the later requests need it in headers localStg.set('token', loginToken.token); + localStg.set('aiToken', loginToken.ai_token); // 2. get user info const pass = await getUserInfo(); diff --git a/src/typings/api/auth.d.ts b/src/typings/api/auth.d.ts index 0fbb802..93f575b 100644 --- a/src/typings/api/auth.d.ts +++ b/src/typings/api/auth.d.ts @@ -6,6 +6,7 @@ declare namespace Api { */ namespace Auth { interface LoginToken { + ai_token: string; token: string; refreshToken: string; } diff --git a/src/typings/storage.d.ts b/src/typings/storage.d.ts index 2bc81aa..fa357ac 100644 --- a/src/typings/storage.d.ts +++ b/src/typings/storage.d.ts @@ -14,6 +14,8 @@ declare namespace StorageType { userInfo: any; /** The i18n language */ lang: App.I18n.LangType; + /** The ai token */ + aiToken: string; /** The token */ token: string; /** Fixed sider with mix-menu */