From 6e6f5cb0965445abb49bc50da1f9003d9027439f Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Thu, 5 Sep 2024 17:50:04 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/utils/dict.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/web-antd/src/utils/dict.ts b/apps/web-antd/src/utils/dict.ts index dca5e02a..cccb0baa 100644 --- a/apps/web-antd/src/utils/dict.ts +++ b/apps/web-antd/src/utils/dict.ts @@ -15,10 +15,8 @@ export function getDict(dictName: string): DictData[] { const { getDict, setDictInfo } = useDictStore(); // 这里拿到 const dictList = getDict(dictName); - if ( - dictList.length === 0 && // 检查请求状态缓存 - !dictRequestCache.has(dictName) - ) { + // 检查请求状态缓存 + if (dictList.length === 0 && !dictRequestCache.has(dictName)) { dictRequestCache.set( dictName, dictDataInfo(dictName).then((resp) => { @@ -36,10 +34,8 @@ export function getDict(dictName: string): DictData[] { export function getDictOptions(dictName: string): Option[] { const { getDictOptions, setDictInfo } = useDictStore(); const dictOptionList = getDictOptions(dictName); - if ( - dictOptionList.length === 0 && // 检查请求状态缓存 - !dictRequestCache.has(dictName) - ) { + // 检查请求状态缓存 + if (dictOptionList.length === 0 && !dictRequestCache.has(dictName)) { dictRequestCache.set( dictName, dictDataInfo(dictName).then((resp) => {