etherreq 1.0.39 → 1.1.0
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 +0 -3
- package/src/request.js +0 -3
package/package.json
CHANGED
package/src/etherreq.js
CHANGED
|
@@ -26,7 +26,6 @@ const dispatchRequest = async (config) => {
|
|
|
26
26
|
let response;
|
|
27
27
|
const { url, method = 'GET', headers = {}, body } = config;
|
|
28
28
|
let text = '';
|
|
29
|
-
|
|
30
29
|
try {
|
|
31
30
|
const options = {
|
|
32
31
|
method,
|
|
@@ -35,9 +34,7 @@ const dispatchRequest = async (config) => {
|
|
|
35
34
|
};
|
|
36
35
|
|
|
37
36
|
const res = await fetch(url, options);
|
|
38
|
-
|
|
39
37
|
text = await res.text();
|
|
40
|
-
|
|
41
38
|
if (!res.ok) {
|
|
42
39
|
throw new Error(`HTTP 错误: ${res.status} - ${res.statusText}`);
|
|
43
40
|
}
|
package/src/request.js
CHANGED
|
@@ -20,10 +20,7 @@ instance.interceptors.request.use((config) => {
|
|
|
20
20
|
if (config.method === 'GET' && !config.disableCache) {
|
|
21
21
|
const cacheKey = getCacheKey(config.url, config);
|
|
22
22
|
const cached = requestCache.get(cacheKey);
|
|
23
|
-
console.log("缓存数据:", cached);
|
|
24
|
-
|
|
25
23
|
if (cached) {
|
|
26
|
-
console.log("缓存命中");
|
|
27
24
|
const fakeResponse = {
|
|
28
25
|
data: cached,
|
|
29
26
|
status: 200,
|