Skip to content

Commit

Permalink
fix: 修复字典缓存后刷新页面不会翻译的bug
Browse files Browse the repository at this point in the history
kanyxmo committed Apr 2, 2024
1 parent 784b98a commit 3513c42
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/ma-form/js/networkRequest.js
Original file line number Diff line number Diff line change
@@ -109,12 +109,12 @@ export const loadDict = async (dictList, item, sourceList = [], maFormObject = {
} else {
const dictData = tool.local.get('dictData') ?? {}
if (item.dict.cache && dictData[dataIndex]) {
dictList[dataIndex] = dictData[dataIndex]
dictList[dataIndex] = handlerDictProps(item, dictData[dataIndex])
} else {
const { data } = await requestDict(item.dict.remote, 'POST', {}, requestData)
dictList[dataIndex] = handlerDictProps(item, data)
if (item.dict.cache) {
dictData[dataIndex] = dictList[dataIndex]
dictData[dataIndex] = data
tool.local.set('dictData', dictData)
}
}
@@ -138,12 +138,12 @@ export const loadDict = async (dictList, item, sourceList = [], maFormObject = {
} else {
const dictData = tool.local.get('dictData') ?? {}
if (item.dict.cache && dictData[dataIndex]) {
dictList[dataIndex] = dictData[dataIndex]
dictList[dataIndex] = handlerDictProps(item, dictData[dataIndex])
} else {
const { data } = await requestDict(item.dict.url, item.dict.method || 'GET', item.dict.params || {}, item.dict.body || {})
dictList[dataIndex] = handlerDictProps(item, data)
if (item.dict.cache) {
dictData[dataIndex] = dictList[dataIndex]
dictData[dataIndex] = data
tool.local.set('dictData', dictData)
}
}

0 comments on commit 3513c42

Please sign in to comment.