chore: normalize legacy home routes

This commit is contained in:
2026-06-12 13:57:49 +08:00
parent 3d6fd3000a
commit 8138623b30
4 changed files with 7 additions and 5 deletions
@@ -1,7 +1,9 @@
import { preferences } from '@vben/preferences';
const LEGACY_HOME_PATTERNS = [
/^\/app\/[^/]+\/page-render\//,
/^\/app\/[^/]+\/form-render\//,
/^\/page-render\//,
/^\/form-render\//,
];
@@ -53,7 +53,7 @@ const appDynamicTitle = ref(true);
const appWatermark = ref(false);
const appWatermarkContent = ref('');
const appEnableCheckUpdates = ref(true);
const appDefaultHomePath = ref('/analytics');
const appDefaultHomePath = ref('/ai-platform/agent');
const appEnablePreferences = ref(true);
const footerEnable = ref(true);
@@ -106,7 +106,7 @@ function getDefaultConfig() {
defaultHomePath:
overrides.app?.defaultHomePath ||
preferences.app.defaultHomePath ||
'/page-render/main_home',
'/ai-platform/agent',
enablePreferences: overrides.app?.enablePreferences ?? true,
},
footer: {
@@ -229,7 +229,7 @@ async function loadConfig() {
// 获取带子应用前缀的首页路径
function getDefaultHomePathWithPrefix(): string {
const path = appDefaultHomePath.value || '/analytics';
const path = appDefaultHomePath.value || '/ai-platform/agent';
const appCode = appContextStore.appCode;
// 如果是子应用模式且路径不包含子应用前缀,自动添加
if (appCode && !path.startsWith(`/app/${appCode}`)) {