feima-shortcuts 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -270,7 +270,7 @@ export const getResponseHeader = (
|
|
|
270
270
|
|
|
271
271
|
export const getResponseBody = (response: AxiosResponse<any>): any => {
|
|
272
272
|
if (response.status !== 204) {
|
|
273
|
-
return response
|
|
273
|
+
return response;
|
|
274
274
|
}
|
|
275
275
|
return undefined;
|
|
276
276
|
};
|
|
@@ -294,7 +294,6 @@ export const catchErrorCodes = (
|
|
|
294
294
|
if (error) {
|
|
295
295
|
throw new ApiError(options, result, error);
|
|
296
296
|
}
|
|
297
|
-
|
|
298
297
|
if (!result.ok) {
|
|
299
298
|
const errorStatus = result.status ?? "unknown";
|
|
300
299
|
const errorStatusText = result.statusText ?? "unknown";
|
|
@@ -335,7 +334,7 @@ export const request = <T>(
|
|
|
335
334
|
const headers = await getHeaders(config, options, formData);
|
|
336
335
|
|
|
337
336
|
if (!onCancel.isCancelled) {
|
|
338
|
-
const response = await sendRequest<T>(
|
|
337
|
+
const response: any = await sendRequest<T>(
|
|
339
338
|
config,
|
|
340
339
|
options,
|
|
341
340
|
url,
|
|
@@ -350,12 +349,11 @@ export const request = <T>(
|
|
|
350
349
|
response,
|
|
351
350
|
options.responseHeader
|
|
352
351
|
);
|
|
353
|
-
|
|
354
352
|
const result: ApiResult = {
|
|
355
353
|
url,
|
|
356
|
-
ok:
|
|
357
|
-
status: response.
|
|
358
|
-
statusText: response.
|
|
354
|
+
ok: response.ok,
|
|
355
|
+
status: response.code,
|
|
356
|
+
statusText: response.msg,
|
|
359
357
|
body: responseHeader ?? responseBody,
|
|
360
358
|
};
|
|
361
359
|
|
|
@@ -367,6 +365,7 @@ export const request = <T>(
|
|
|
367
365
|
reject(error);
|
|
368
366
|
}
|
|
369
367
|
});
|
|
370
|
-
}
|
|
368
|
+
};
|
|
369
|
+
`
|
|
371
370
|
|
|
372
371
|
module.exports = template;
|