浏览代码

处理positionSecondData

lifanagju_citu 6 月之前
父节点
当前提交
572fcff9bc
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      hooks/useDictionaries.js

+ 3 - 3
hooks/useDictionaries.js

@@ -47,9 +47,6 @@ const setDict = (type, val) => {
       }
       }
     }
     }
   }
   }
-  if (type === 'positionSecondData') {
-    val.data = getSecondNodes(val.data)
-  }
   // 一小时过期
   // 一小时过期
   const currentTime = new Date()
   const currentTime = new Date()
   currentTime.setTime(currentTime.getTime() + 3600 * 1000)
   currentTime.setTime(currentTime.getTime() + 3600 * 1000)
@@ -88,6 +85,9 @@ export const getDict = (type, params, apiType = 'dict') => {
       }
       }
       apiFn[apiType](query).then(data => {
       apiFn[apiType](query).then(data => {
         // setDict(type, data, Date.now())
         // setDict(type, data, Date.now())
+        if (type === 'positionSecondData') {
+          data.data = getSecondNodes(data.data)
+        }
         setDict(type, data)
         setDict(type, data)
         resolve({ data })
         resolve({ data })
       })
       })