Merge pull request #1269 from EightMonth/sas

sas兼容shiro处理
springboot3_sas v3.6.3_springboot3sas
JEECG 2024-06-20 16:09:05 +08:00 committed by GitHub
commit feb04114ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 6 deletions

View File

@ -23,7 +23,7 @@ export interface RoleInfo {
*/
export interface LoginResultModel {
userId: string | number;
access_token: string;
token: string;
role: RoleInfo;
userInfo?: any
}

View File

@ -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',
@ -58,7 +58,6 @@ export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal')
},
},
{
isTransformResponse: false,
errorMessageMode: mode,
}
);

View File

@ -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);
}
},
/**