etherreq 1.0.25 → 1.0.27
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 +1 -1
- package/src/etherreq.js +4 -1
package/package.json
CHANGED
package/src/etherreq.js
CHANGED
|
@@ -15,6 +15,9 @@ export const create = (defaultConfig = {}) => {
|
|
|
15
15
|
for (const interceptor of interceptors.request) {
|
|
16
16
|
config = await interceptor.fulfilled(config);
|
|
17
17
|
}
|
|
18
|
+
let response;
|
|
19
|
+
|
|
20
|
+
|
|
18
21
|
// 否则才发起网络请求
|
|
19
22
|
const { url, method = 'GET', headers = {}, body } = config;
|
|
20
23
|
try {
|
|
@@ -26,7 +29,7 @@ export const create = (defaultConfig = {}) => {
|
|
|
26
29
|
|
|
27
30
|
const res = await fetch(url, options);
|
|
28
31
|
const data = await res.json();
|
|
29
|
-
|
|
32
|
+
let response;
|
|
30
33
|
|
|
31
34
|
|
|
32
35
|
if (!res.ok) {
|