refactor: ♻️ 重构存储键命名规范

This commit is contained in:
Ray.Hao
2025-09-09 11:03:27 +08:00
parent e84d87d403
commit 070a43d540
5 changed files with 148 additions and 79 deletions

View File

@@ -1,9 +1,10 @@
import { store } from "@/store";
import DictAPI, { type DictItemOption } from "@/api/system/dict-api";
import { STORAGE_KEYS } from "@/constants";
export const useDictStore = defineStore("dict", () => {
// 字典数据缓存
const dictCache = useStorage<Record<string, DictItemOption[]>>("dict_cache", {});
const dictCache = useStorage<Record<string, DictItemOption[]>>(STORAGE_KEYS.DICT_CACHE, {});
// 请求队列(防止重复请求)
const requestQueue: Record<string, Promise<void>> = {};