Browse Source

fix(settings): 缓存中未找到自定义设置项需要刷新缓存.

pull/888/head
colin 2 years ago
parent
commit
0b79247e61
  1. 3
      apps/vue/src/store/modules/settings.ts

3
apps/vue/src/store/modules/settings.ts

@ -26,8 +26,9 @@ export const useSettingManagementStore = defineStore({
actions: { actions: {
initlize(settingKey: string, api: (...args) => Promise<ListResultDto<SettingGroup>>) { initlize(settingKey: string, api: (...args) => Promise<ListResultDto<SettingGroup>>) {
this.settingKey = settingKey; this.settingKey = settingKey;
this.settings = ls.get(this.settingKey);
if (this.settings.length === 0) { if (this.settings.length === 0) {
this.settings = ls.get(this.settingKey) || this.refreshSettings(api); this.refreshSettings(api);
} }
}, },
refreshSettings(api: (...args) => Promise<ListResultDto<SettingGroup>>) { refreshSettings(api: (...args) => Promise<ListResultDto<SettingGroup>>) {

Loading…
Cancel
Save