Route legacy home to control center
This commit is contained in:
@@ -13,6 +13,13 @@ import { getAccessCodesApi, loginApi, logoutApi } from '#/api/core/auth';
|
||||
import { getUserInfoApi } from '#/api/core/user';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
function normalizeHomePath(path?: null | string) {
|
||||
if (!path || path === '/page-render/main_home') {
|
||||
return preferences.app.defaultHomePath;
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
export const useAuthStore = defineStore('auth', () => {
|
||||
const accessStore = useAccessStore();
|
||||
const userStore = useUserStore();
|
||||
@@ -64,9 +71,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
} else {
|
||||
onSuccess
|
||||
? await onSuccess?.()
|
||||
: await router.push(
|
||||
userInfo.homePath || preferences.app.defaultHomePath,
|
||||
);
|
||||
: await router.push(normalizeHomePath(userInfo.homePath));
|
||||
}
|
||||
|
||||
if (userInfo?.realName) {
|
||||
|
||||
Reference in New Issue
Block a user