chore: normalize legacy home routes
This commit is contained in:
@@ -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}`)) {
|
||||
|
||||
@@ -17,7 +17,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
||||
"contentPaddingRight": 0,
|
||||
"contentPaddingTop": 0,
|
||||
"defaultAvatar": "https://unpkg.com/@vbenjs/static-source@0.1.7/source/avatar-v1.webp",
|
||||
"defaultHomePath": "/page-render/main_home",
|
||||
"defaultHomePath": "/ai-platform/agent",
|
||||
"dynamicTitle": true,
|
||||
"enableCheckUpdates": true,
|
||||
"enablePreferences": true,
|
||||
|
||||
@@ -17,7 +17,7 @@ const defaultPreferences: Preferences = {
|
||||
contentPaddingTop: 0,
|
||||
defaultAvatar:
|
||||
'https://unpkg.com/@vbenjs/static-source@0.1.7/source/avatar-v1.webp',
|
||||
defaultHomePath: '/page-render/main_home',
|
||||
defaultHomePath: '/ai-platform/agent',
|
||||
dynamicTitle: true,
|
||||
enableCheckUpdates: true,
|
||||
enablePreferences: true,
|
||||
|
||||
Reference in New Issue
Block a user