74 lines
1.8 KiB
TypeScript
74 lines
1.8 KiB
TypeScript
import type { RuntimeSetting } from './config/setting';
|
|
|
|
import { defineOverridesPreferences } from '@vben/preferences';
|
|
|
|
/**
|
|
* @description 项目配置文件
|
|
* 只需要覆盖项目中的一部分配置,不需要的配置不用覆盖,会自动使用默认配置
|
|
* !!! 更改配置后请清空缓存,否则可能不生效
|
|
*/
|
|
function createOverridesPreferences(setting: RuntimeSetting) {
|
|
return defineOverridesPreferences({
|
|
// overrides
|
|
app: {
|
|
name: setting.appTitle || '',
|
|
accessMode: 'backend',
|
|
authPageLayout: 'panel-right',
|
|
layout: 'header-sidebar-nav',
|
|
},
|
|
breadcrumb: {
|
|
enable: false,
|
|
},
|
|
shortcutKeys: {
|
|
enable: false,
|
|
},
|
|
tabbar: {
|
|
styleType: 'plain',
|
|
},
|
|
theme: {
|
|
mode: 'light',
|
|
radius: '0.25',
|
|
},
|
|
logo: {
|
|
enable: true,
|
|
source: setting.appIcon || '',
|
|
},
|
|
copyright: {
|
|
enable: true,
|
|
companyName: setting.copyright?.companyName || '',
|
|
companySiteLink: setting.copyright?.companySiteLink || '',
|
|
date: setting.copyright?.date || '',
|
|
icp: setting.copyright?.icp || '',
|
|
icpLink: setting.copyright?.icpLink || '',
|
|
},
|
|
widget: {
|
|
refresh: false,
|
|
},
|
|
});
|
|
}
|
|
|
|
export { createOverridesPreferences };
|
|
|
|
// {
|
|
// // overrides
|
|
// app: {
|
|
// name: import.meta.env.VITE_APP_TITLE,
|
|
// accessMode: 'backend',
|
|
// },
|
|
// theme: {
|
|
// mode: "light"
|
|
// },
|
|
// logo: {
|
|
// enable: true,
|
|
// source: '/logo.png',
|
|
// },
|
|
// copyright: {
|
|
// enable: true,
|
|
// companyName: "示例企业",
|
|
// companySiteLink: "https://example.com",
|
|
// date: "2024-2025",
|
|
// icp: "示例ICP备00000000号-1",
|
|
// icpLink: "https://beian.miit.gov.cn/",
|
|
// },
|
|
// }
|