Quellcode durchsuchen

positionSecondData

lifanagju_citu vor 6 Monaten
Ursprung
Commit
dc6f02e0c4
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      src/hooks/web/useDictionaries.js

+ 3 - 3
src/hooks/web/useDictionaries.js

@@ -13,9 +13,6 @@ import { getSecondNodes } from '@/utils/dealData'
 
 // const setDict = (type, val, cacheTime = 7200) => {
 const setDict = (type, val) => {
-  if (type === 'positionSecondData') {
-    val = getSecondNodes(val)
-  }
   // 一小时过期
   const currentTime = new Date()
   currentTime.setTime(currentTime.getTime() + 3600 * 1000)
@@ -62,6 +59,9 @@ export const getDict = (type, params, apiType = 'dict') => {
             return e
           }) : []
         }
+        if (type === 'positionSecondData') {
+          data = getSecondNodes(data)
+        }
         setDict(type, data)
         resolve({ data })
       })