Skip to content

Commit

Permalink
Merge pull request #1269 from EightMonth/sas
Browse files Browse the repository at this point in the history
sas兼容shiro处理
  • Loading branch information
zhangdaiscott authored Jun 20, 2024
2 parents 21e1562 + 74c9559 commit feb0411
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/sys/model/userModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface RoleInfo {
*/
export interface LoginResultModel {
userId: string | number;
access_token: string;
token: string;
role: RoleInfo;
userInfo?: any
}
Expand Down
3 changes: 1 addition & 2 deletions src/api/sys/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PageEnum } from '/@/enums/pageEnum';

const { createErrorModal } = useMessage();
enum Api {
Login = '/oauth2/token',
Login = '/sys/login',
phoneLogin = '/oauth2/token',
Logout = '/sys/logout',
GetUserInfo = '/sys/user/getUserInfo',
Expand Down Expand Up @@ -58,7 +58,6 @@ export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal')
},
},
{
isTransformResponse: false,
errorMessageMode: mode,
}
);
Expand Down
6 changes: 3 additions & 3 deletions src/store/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ export const useUserStore = defineStore({
const { goHome = true, mode, ...loginParams } = params;
loginParams.grant_type = 'password';
const data = await loginApi(loginParams, mode);
const { access_token, userInfo } = data;
const { token, userInfo } = data;
// save token
this.setToken(access_token);
this.setToken(token);
this.setTenant(userInfo.loginTenantId);
return this.afterLoginAction(goHome, data);
} catch (error) {
return Promise.reject(error.response.data);
return Promise.reject(error);
}
},
/**
Expand Down

0 comments on commit feb0411

Please sign in to comment.