etherreq 1.1.2 → 1.1.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/request.js +7 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etherreq",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A lightweight custom HTTP request library.",
5
5
  "main": "src/index.js",
6
6
  "types": "src/types/etherreq.d.ts",
package/src/request.js CHANGED
@@ -21,13 +21,13 @@ instance.interceptors.request.use((config) => {
21
21
  const cacheKey = getCacheKey(config.url, config);
22
22
  const cached = requestCache.get(cacheKey);
23
23
  if (cached) {
24
- // const fakeResponse = {
25
- // data: cached,
26
- // status: 200,
27
- // statusText: 'OK',
28
- // config,
29
- // isFromCache: true, // ✅ 添加标志位
30
- // };
24
+ const fakeResponse = {
25
+ data: cached,
26
+ status: 200,
27
+ statusText: 'OK',
28
+ config,
29
+ isFromCache: true, // ✅ 添加标志位
30
+ };
31
31
  console.log('使用缓存数据');
32
32
  console.log(cached);
33
33