feat: 单点登录
This commit is contained in:
@ -131,11 +131,12 @@ export const useUserStore = defineStore({
|
||||
): Promise<GetUserInfoModel | null> {
|
||||
try {
|
||||
const data = await singleLoginApi(params, params.mode);
|
||||
const userInfo = await this.getUserInfoAction();
|
||||
|
||||
const { token } = data;
|
||||
// save token
|
||||
this.setToken(token);
|
||||
router.replace(params.targetURL)
|
||||
router.replace(params.targetURL || params.redirect || userInfo?.homePath || PageEnum.BASE_HOME)
|
||||
|
||||
return await this.afterLoginAction(false);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user