Restore rendered control center home
This commit is contained in:
@@ -32,6 +32,7 @@ const baseModules = import.meta.glob([
|
|||||||
const businessModules = import.meta.glob([
|
const businessModules = import.meta.glob([
|
||||||
'./langs/zh-CN/ai-platform.json',
|
'./langs/zh-CN/ai-platform.json',
|
||||||
'./langs/zh-CN/announcement.json',
|
'./langs/zh-CN/announcement.json',
|
||||||
|
'./langs/zh-CN/dashboard-design.json',
|
||||||
'./langs/zh-CN/menu.json',
|
'./langs/zh-CN/menu.json',
|
||||||
'./langs/zh-CN/message.json',
|
'./langs/zh-CN/message.json',
|
||||||
'./langs/zh-CN/permission.json',
|
'./langs/zh-CN/permission.json',
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const overridesPreferences = defineOverridesPreferences({
|
|||||||
enablePreferences: false,
|
enablePreferences: false,
|
||||||
accessMode: 'mixed',
|
accessMode: 'mixed',
|
||||||
authPageLayout: 'panel-center',
|
authPageLayout: 'panel-center',
|
||||||
defaultHomePath: '/control-center',
|
defaultHomePath: '/page-render/main_home',
|
||||||
layout: 'header-sidebar-nav',
|
layout: 'header-sidebar-nav',
|
||||||
},
|
},
|
||||||
shortcutKeys: {
|
shortcutKeys: {
|
||||||
|
|||||||
@@ -71,14 +71,19 @@ function normalizePageMap(pageMap: ComponentRecordType) {
|
|||||||
) as ComponentRecordType;
|
) as ComponentRecordType;
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizeBackendRoute<T extends { component?: string; name?: string; path?: string; query?: unknown }>(
|
function normalizeBackendRoute<
|
||||||
route: T,
|
T extends {
|
||||||
) {
|
component?: string;
|
||||||
|
name?: string;
|
||||||
|
path?: string;
|
||||||
|
query?: unknown;
|
||||||
|
},
|
||||||
|
>(route: T) {
|
||||||
if (route.name !== 'ControlCenter') return route;
|
if (route.name !== 'ControlCenter') return route;
|
||||||
|
|
||||||
const normalized = { ...route };
|
const normalized = { ...route };
|
||||||
normalized.path = '/control-center';
|
normalized.path = '/page-render/main_home';
|
||||||
normalized.component = '_core/control-center/index';
|
normalized.component = 'online-dev/page-render/index';
|
||||||
normalized.query = undefined;
|
normalized.query = undefined;
|
||||||
return normalized;
|
return normalized;
|
||||||
}
|
}
|
||||||
@@ -154,6 +159,7 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
|||||||
'../views/ai-platform/workflow/editor/index.vue',
|
'../views/ai-platform/workflow/editor/index.vue',
|
||||||
'../views/ai-platform/workflow/index.vue',
|
'../views/ai-platform/workflow/index.vue',
|
||||||
'../views/ai-platform/workflow-runs/index.vue',
|
'../views/ai-platform/workflow-runs/index.vue',
|
||||||
|
'../views/online-dev/page-render/index.vue',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const layoutMap: ComponentRecordType = {
|
const layoutMap: ComponentRecordType = {
|
||||||
@@ -168,9 +174,8 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) {
|
|||||||
return await generateAccessible(preferences.app.accessMode, {
|
return await generateAccessible(preferences.app.accessMode, {
|
||||||
...options,
|
...options,
|
||||||
fetchMenuListAsync: async () => {
|
fetchMenuListAsync: async () => {
|
||||||
const { ElMessage } = await import(
|
const { ElMessage } =
|
||||||
'element-plus/es/components/message/index'
|
await import('element-plus/es/components/message/index');
|
||||||
);
|
|
||||||
ElMessage({
|
ElMessage({
|
||||||
duration: 1500,
|
duration: 1500,
|
||||||
message: `${$t('common.loadingMenu')}...`,
|
message: `${$t('common.loadingMenu')}...`,
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ function setupAccessGuard(router: Router) {
|
|||||||
|
|
||||||
if (to.path === subAppRootPath) {
|
if (to.path === subAppRootPath) {
|
||||||
const defaultHome =
|
const defaultHome =
|
||||||
preferences.app.defaultHomePath || '/control-center';
|
preferences.app.defaultHomePath || '/page-render/main_home';
|
||||||
// 确保路径包含子应用前缀
|
// 确保路径包含子应用前缀
|
||||||
const subAppTargetPath = defaultHome.startsWith(subAppRootPath)
|
const subAppTargetPath = defaultHome.startsWith(subAppRootPath)
|
||||||
? defaultHome
|
? defaultHome
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { preferences } from '@vben/preferences';
|
|||||||
|
|
||||||
const LEGACY_HOME_PATTERNS = [
|
const LEGACY_HOME_PATTERNS = [
|
||||||
/^\/app\/[^/]+\/form-render\//,
|
/^\/app\/[^/]+\/form-render\//,
|
||||||
/^\/page-render\/main_home$/,
|
|
||||||
/^\/form-render\//,
|
/^\/form-render\//,
|
||||||
/^\/online-dev(?:\/|$)/,
|
/^\/online-dev(?:\/|$)/,
|
||||||
/^\/online-development(?:\/|$)/,
|
/^\/online-development(?:\/|$)/,
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ function getDefaultConfig() {
|
|||||||
defaultHomePath:
|
defaultHomePath:
|
||||||
overrides.app?.defaultHomePath ||
|
overrides.app?.defaultHomePath ||
|
||||||
preferences.app.defaultHomePath ||
|
preferences.app.defaultHomePath ||
|
||||||
'/control-center',
|
'/page-render/main_home',
|
||||||
enablePreferences: overrides.app?.enablePreferences ?? true,
|
enablePreferences: overrides.app?.enablePreferences ?? true,
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
@@ -131,9 +131,13 @@ function getDefaultConfig() {
|
|||||||
policeIcp:
|
policeIcp:
|
||||||
overrides.copyright?.policeIcp || preferences.copyright.policeIcp || '',
|
overrides.copyright?.policeIcp || preferences.copyright.policeIcp || '',
|
||||||
policeIcpLink:
|
policeIcpLink:
|
||||||
overrides.copyright?.policeIcpLink || preferences.copyright.policeIcpLink || '',
|
overrides.copyright?.policeIcpLink ||
|
||||||
|
preferences.copyright.policeIcpLink ||
|
||||||
|
'',
|
||||||
loginOnly:
|
loginOnly:
|
||||||
overrides.copyright?.loginOnly ?? preferences.copyright.loginOnly ?? true,
|
overrides.copyright?.loginOnly ??
|
||||||
|
preferences.copyright.loginOnly ??
|
||||||
|
true,
|
||||||
},
|
},
|
||||||
logo: {
|
logo: {
|
||||||
enable: overrides.logo?.enable ?? preferences.logo.enable ?? true,
|
enable: overrides.logo?.enable ?? preferences.logo.enable ?? 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: '/control-center',
|
defaultHomePath: '/page-render/main_home',
|
||||||
dynamicTitle: true,
|
dynamicTitle: true,
|
||||||
enableCheckUpdates: true,
|
enableCheckUpdates: true,
|
||||||
enablePreferences: true,
|
enablePreferences: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user