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 */