etherreq 1.0.29 → 1.0.31

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "etherreq",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
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
@@ -25,7 +25,21 @@ instance.interceptors.request.use((config) => {
25
25
 
26
26
  if (cached) {
27
27
  console.log("缓存命中");
28
- return Promise.resolve(cached); // 这里返回的就是 response.data
28
+ // return Promise.resolve(cached); // 这里返回的就是 response.data
29
+ const a={
30
+ "data": {
31
+ "id": 123,
32
+ "name": "张三",
33
+ "email": "zhangsan@example.com"
34
+ },
35
+ "status": 200,
36
+ "statusText": "OK",
37
+ "headers": {
38
+ "content-type": "application/json"
39
+ }
40
+ }
41
+ console.log("返回数据:",a);
42
+ return a;
29
43
  }
30
44
  }
31
45
 
@@ -26,7 +26,7 @@ interface EtherreqStatic extends EtherRequestMethod {
26
26
  put: EtherRequestMethod;
27
27
  delete: EtherRequestMethod;
28
28
  del: EtherRequestMethod;
29
- login: EtherRequestMethod; // 新增 login 类型
29
+ login: EtherRequestMethod;
30
30
  }
31
31
 
32
32
  // 导出对象