chore: normalize legacy home routes
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
import { preferences } from '@vben/preferences';
|
import { preferences } from '@vben/preferences';
|
||||||
|
|
||||||
const LEGACY_HOME_PATTERNS = [
|
const LEGACY_HOME_PATTERNS = [
|
||||||
|
/^\/app\/[^/]+\/page-render\//,
|
||||||
/^\/app\/[^/]+\/form-render\//,
|
/^\/app\/[^/]+\/form-render\//,
|
||||||
|
/^\/page-render\//,
|
||||||
/^\/form-render\//,
|
/^\/form-render\//,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const appDynamicTitle = ref(true);
|
|||||||
const appWatermark = ref(false);
|
const appWatermark = ref(false);
|
||||||
const appWatermarkContent = ref('');
|
const appWatermarkContent = ref('');
|
||||||
const appEnableCheckUpdates = ref(true);
|
const appEnableCheckUpdates = ref(true);
|
||||||
const appDefaultHomePath = ref('/analytics');
|
const appDefaultHomePath = ref('/ai-platform/agent');
|
||||||
const appEnablePreferences = ref(true);
|
const appEnablePreferences = ref(true);
|
||||||
|
|
||||||
const footerEnable = ref(true);
|
const footerEnable = ref(true);
|
||||||
@@ -106,7 +106,7 @@ function getDefaultConfig() {
|
|||||||
defaultHomePath:
|
defaultHomePath:
|
||||||
overrides.app?.defaultHomePath ||
|
overrides.app?.defaultHomePath ||
|
||||||
preferences.app.defaultHomePath ||
|
preferences.app.defaultHomePath ||
|
||||||
'/page-render/main_home',
|
'/ai-platform/agent',
|
||||||
enablePreferences: overrides.app?.enablePreferences ?? true,
|
enablePreferences: overrides.app?.enablePreferences ?? true,
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
@@ -229,7 +229,7 @@ async function loadConfig() {
|
|||||||
|
|
||||||
// 获取带子应用前缀的首页路径
|
// 获取带子应用前缀的首页路径
|
||||||
function getDefaultHomePathWithPrefix(): string {
|
function getDefaultHomePathWithPrefix(): string {
|
||||||
const path = appDefaultHomePath.value || '/analytics';
|
const path = appDefaultHomePath.value || '/ai-platform/agent';
|
||||||
const appCode = appContextStore.appCode;
|
const appCode = appContextStore.appCode;
|
||||||
// 如果是子应用模式且路径不包含子应用前缀,自动添加
|
// 如果是子应用模式且路径不包含子应用前缀,自动添加
|
||||||
if (appCode && !path.startsWith(`/app/${appCode}`)) {
|
if (appCode && !path.startsWith(`/app/${appCode}`)) {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
|||||||
"contentPaddingRight": 0,
|
"contentPaddingRight": 0,
|
||||||
"contentPaddingTop": 0,
|
"contentPaddingTop": 0,
|
||||||
"defaultAvatar": "https://unpkg.com/@vbenjs/static-source@0.1.7/source/avatar-v1.webp",
|
"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,
|
"dynamicTitle": true,
|
||||||
"enableCheckUpdates": true,
|
"enableCheckUpdates": true,
|
||||||
"enablePreferences": true,
|
"enablePreferences": true,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const defaultPreferences: Preferences = {
|
|||||||
contentPaddingTop: 0,
|
contentPaddingTop: 0,
|
||||||
defaultAvatar:
|
defaultAvatar:
|
||||||
'https://unpkg.com/@vbenjs/static-source@0.1.7/source/avatar-v1.webp',
|
'https://unpkg.com/@vbenjs/static-source@0.1.7/source/avatar-v1.webp',
|
||||||
defaultHomePath: '/page-render/main_home',
|
defaultHomePath: '/ai-platform/agent',
|
||||||
dynamicTitle: true,
|
dynamicTitle: true,
|
||||||
enableCheckUpdates: true,
|
enableCheckUpdates: true,
|
||||||
enablePreferences: true,
|
enablePreferences: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user