shenwu 2 anni fa
parent
commit
e5b846ab48
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      src/Hook/useAjax.tsx

+ 2 - 1
src/Hook/useAjax.tsx

@@ -49,7 +49,8 @@ export function useAjax(fnc: CombineService<any, any>, options?: Options){
         // throttleInterval:500,
         formatResult: (res) => {
             let reqTime = moment().format('YYYY-MM-DD HH:mm:ss')
-            return options?.formatResult ? {...res,reqTime} :Array.isArray(res.data) ? {data:res.data,reqTime} :{...res.data,reqTime}
+            res['reqTime'] = reqTime
+            return options?.formatResult ? {...res,reqTime} :res
             
         },
         onSuccess: (res) => {