feat: 字典实时同步和首页添加在线用户统计

This commit is contained in:
Ray.Hao
2025-04-22 22:15:15 +08:00
parent cad57b3dc0
commit fdf66164d8
14 changed files with 1275 additions and 70 deletions

View File

@@ -42,6 +42,16 @@ export const useDictStore = defineStore("dict", () => {
return dictCache.value[dictCode] || [];
};
/**
* 移除指定字典项
* @param dictCode 字典编码
*/
const removeDictItem = (dictCode: string) => {
if (dictCache.value[dictCode]) {
Reflect.deleteProperty(dictCache.value, dictCode);
}
};
/**
* 清空字典缓存
*/
@@ -52,6 +62,7 @@ export const useDictStore = defineStore("dict", () => {
return {
loadDictItems,
getDictItems,
removeDictItem,
clearDictCache,
};
});