Explorar o código

fix(http): 修改http请求返回数据为responseData.data

之前直接返回整个responseData,现在改为只返回data字段以符合业务需求
feige996 hai 6 meses
pai
achega
6fcb03ee53
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      src/http/http.ts

+ 1 - 2
src/http/http.ts

@@ -101,8 +101,7 @@ export function http<T>(options: CustomRequestOptions) {
               title: responseData.msg || responseData.message || '请求错误',
             })
           }
-          // TODO: check 如果不满足业务要求,也可以改为 reject(responseData as T)
-          return resolve(responseData as T)
+          return resolve(responseData.data)
         }
 
         // 处理其他错误