refactor: refacotr preference
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
import { setupPreference } from '@vben/preference';
|
||||
import { preferencesManager } from '@vben-core/preferences';
|
||||
|
||||
import { overridesPreference } from './preference';
|
||||
import { overridesPreferences } from './preferences';
|
||||
|
||||
/**
|
||||
* 应用初始化完成之后再进行页面加载渲染
|
||||
*/
|
||||
async function initApplication() {
|
||||
// name用于指定项目唯一标识
|
||||
// 用于区分不同项目的偏好设置以及存储数据的key前缀以及其他一些需要隔离的数据
|
||||
const env = import.meta.env.PROD ? 'prod' : 'dev';
|
||||
const namespace = `${import.meta.env.VITE_APP_NAMESPACE}-${env}`;
|
||||
|
||||
// app偏好设置初始化
|
||||
await setupPreference({
|
||||
await preferencesManager.initPreferences({
|
||||
namespace,
|
||||
overrides: overridesPreference,
|
||||
overrides: overridesPreferences,
|
||||
});
|
||||
|
||||
import('./bootstrap').then((m) => m.bootstrap(namespace));
|
||||
|
Reference in New Issue
Block a user