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
@@ -11,6 +11,8 @@ import { $t } from '@vben/locales';
import { getPreferencesConfigApi } from '#/api/core/ui-config';
import { useAuthStore } from '#/store';
const LEGACY_HOME_PATH = '/page-render/main_home';
defineOptions({ name: 'Login' });
const authStore = useAuthStore();
@@ -59,6 +61,10 @@ const getRedirectState = () => {
return redirect ? JSON.stringify({ redirect }) : undefined;
};
function normalizeRedirectPath(path: string) {
return path === LEGACY_HOME_PATH ? '/' : path;
}
type OAuthProvider =
| 'dingtalk'
| 'feishu'
@@ -109,7 +115,7 @@ async function handleLogin(params: Record<string, any>) {
if (redirect) {
// 有 redirect 参数时,登录成功后跳转到指定页面
await authStore.authLogin(params, async () => {
const targetPath = decodeURIComponent(redirect);
const targetPath = normalizeRedirectPath(decodeURIComponent(redirect));
await router.push(targetPath);
});
} else {