Browse Source
Merge pull request #888 from colinin/fix-no-settings-refresh-by-api
fix(settings): 缓存中未找到自定义设置项需要刷新缓存.
pull/914/head
yx lin
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
apps/vue/src/store/modules/settings.ts
|
|
|
@ -26,8 +26,9 @@ export const useSettingManagementStore = defineStore({ |
|
|
|
actions: { |
|
|
|
initlize(settingKey: string, api: (...args) => Promise<ListResultDto<SettingGroup>>) { |
|
|
|
this.settingKey = settingKey; |
|
|
|
this.settings = ls.get(this.settingKey); |
|
|
|
if (this.settings.length === 0) { |
|
|
|
this.settings = ls.get(this.settingKey) || this.refreshSettings(api); |
|
|
|
this.refreshSettings(api); |
|
|
|
} |
|
|
|
}, |
|
|
|
refreshSettings(api: (...args) => Promise<ListResultDto<SettingGroup>>) { |
|
|
|
|