mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-27 06:41:12 +00:00
feat(store): 为 notice、user 和 config store 启用持久化
在 store/index.js 中为 noticeStore、userStore 和 configStore 添加了 persist: true,以确保这些 store 的状态在页面刷新后能够持久化保存。 refactor(layout): 优化退出登录逻辑 在 basicLayout.vue 中,退出登录时增加了清空 Pinia 状态的逻辑,确保用户信息、配置和通知等状态在退出时被重置。 fix(dict): 修复字典类型选项加载问题 在 system/dict/data.vue 中,确保在 onMounted 钩子中加载字典类型选项,并根据路由参数初始化查询状态。
This commit is contained in:
@@ -38,6 +38,7 @@ export const useNoticeStore = defineStore("notice", {
|
||||
this.isNoticeLoaded = false;
|
||||
},
|
||||
},
|
||||
persist: true
|
||||
});
|
||||
|
||||
export const useUserStore = defineStore("user", {
|
||||
@@ -72,6 +73,7 @@ export const useUserStore = defineStore("user", {
|
||||
this.hasGetRoute = false;
|
||||
},
|
||||
},
|
||||
persist: true // 当前 store 启用了持久化
|
||||
});
|
||||
|
||||
export const useConfigStore = defineStore("config", {
|
||||
@@ -96,6 +98,7 @@ export const useConfigStore = defineStore("config", {
|
||||
return this.configData[key] || null;
|
||||
},
|
||||
},
|
||||
persist: true
|
||||
});
|
||||
|
||||
export const useDictStore = defineStore('dict', {
|
||||
|
||||
Reference in New Issue
Block a user