shenwu %!s(int64=2) %!d(string=hai) anos
pai
achega
32f10d78d5
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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} : {...res.data,reqTime}
+            return options?.formatResult ? {...res,reqTime} :Array.isArray(res.data) ? {data:res.data,reqTime} :{...res.data,reqTime}
+            
         },
         onSuccess: (res) => {
             if (res) {