feat: use simpler nitro instead of nestjs to implement mock service
This commit is contained in:
@@ -4,7 +4,7 @@ import type { Preferences } from './types';
|
||||
|
||||
import { markRaw, reactive, readonly, watch } from 'vue';
|
||||
|
||||
import { StorageManager, merge } from '@vben-core/toolkit';
|
||||
import { StorageManager, isMacOs, merge } from '@vben-core/toolkit';
|
||||
|
||||
import {
|
||||
breakpointsTailwind,
|
||||
@@ -46,7 +46,7 @@ class PreferenceManager {
|
||||
|
||||
this.savePreferences = useDebounceFn(
|
||||
(preference: Preferences) => this._savePreferences(preference),
|
||||
200,
|
||||
100,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,6 +81,11 @@ class PreferenceManager {
|
||||
}
|
||||
}
|
||||
|
||||
private initPlatform() {
|
||||
const dom = document.documentElement;
|
||||
dom.dataset.platform = isMacOs() ? 'macOs' : 'window';
|
||||
}
|
||||
|
||||
/**
|
||||
* 从缓存中加载偏好设置。如果缓存中没有找到对应的偏好设置,则返回默认偏好设置。
|
||||
*/
|
||||
@@ -187,6 +192,8 @@ class PreferenceManager {
|
||||
this.updatePreferences(mergedPreference);
|
||||
|
||||
this.setupWatcher();
|
||||
|
||||
this.initPlatform();
|
||||
// 标记为已初始化
|
||||
this.isInitialized = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user