Browse Source

处理positionSecondData

lifanagju_citu 6 tháng trước cách đây
mục cha
commit
572fcff9bc
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  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()
   currentTime.setTime(currentTime.getTime() + 3600 * 1000)
@@ -88,6 +85,9 @@ export const getDict = (type, params, apiType = 'dict') => {
       }
       apiFn[apiType](query).then(data => {
         // setDict(type, data, Date.now())
+        if (type === 'positionSecondData') {
+          data.data = getSecondNodes(data.data)
+        }
         setDict(type, data)
         resolve({ data })
       })