Route legacy home to control center

This commit is contained in:
2026-06-09 18:33:03 +08:00
parent cf8385f1dc
commit 39aa708c4f
4 changed files with 28 additions and 13 deletions
+8 -3
View File
@@ -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) {