diff --git a/kicc-ui/src/api/sys/model/userModel.ts b/kicc-ui/src/api/sys/model/userModel.ts index 38c60fe1..0b6ab320 100644 --- a/kicc-ui/src/api/sys/model/userModel.ts +++ b/kicc-ui/src/api/sys/model/userModel.ts @@ -1,6 +1,8 @@ /** * @description: Login interface parameters */ +import {string} from "vue-types"; + export interface LoginParams { username: string; password: string; @@ -13,20 +15,34 @@ export interface RoleInfo { value: string; } +export interface UserInfo { + accountNonExpired: boolean; + accountNonLocked: boolean; + authorities: Recordable; + credentialsNonExpired: boolean; + deptId: string; + enabled: boolean; + id: string; + password?: string; + phone: string; + tenantId: string; + username: string; + [key: string]: any; +} + + /** * @description: Login interface return value */ export interface LoginResultModel { - userId: string | number; - token: string; - role: RoleInfo; - accessToken: string; - avatar: string; - jti: string; - refreshToken: string; - roleId: string | number; - tenantId: string; - userName: string; + access_token: string; + clientId: string; + expires_in: number; + license: string; + refresh_token: string; + scope: string; + token_type: string; + user_info: UserInfo; } /** diff --git a/kicc-ui/src/store/modules/user.ts b/kicc-ui/src/store/modules/user.ts index 55165176..9c1c50fb 100644 --- a/kicc-ui/src/store/modules/user.ts +++ b/kicc-ui/src/store/modules/user.ts @@ -76,12 +76,13 @@ export const useUserStore = defineStore({ */ async login(params: LoginParams & { goHome?: boolean; }): Promise { try { + debugger; const { goHome = true, ...loginParams } = params; const data = await loginApi(loginParams); - const { accessToken } = data; + const { access_token } = data; // 保存令牌 - this.setToken(accessToken); + this.setToken(access_token); // 获取用户信息 const userInfo = await this.getUserInfoAction();