fastman3-dfyjapp-request 1.2.1 → 1.2.2

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/README.md CHANGED
@@ -139,3 +139,7 @@
139
139
  ### v 1.2.1 - 2026.03.24
140
140
 
141
141
  1. 微信端仍然使用LocalStorage机制
142
+
143
+ ### v 1.2.2 - 2026.04.15
144
+
145
+ 1. 微信端仍然使用LocalStorage机制
@@ -1,12 +1,3 @@
1
- /*
2
- * @Author: shenzhiwei
3
- * @Date: 2021-03-28 14:19:34
4
- * @Company: orientsec.com.cn
5
- * @Description: UI交互上的最终处理 chain
6
- */
7
- // import { removeStorageSync } from "fastman3-dfyjapp-syncstorage";
8
- // import { TOKEN_KEY } from "../constants";
9
- // import { storeToken } from "../utils";
10
1
  var __assign = this && this.__assign || function () {
11
2
  __assign = Object.assign || function (t) {
12
3
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -17,6 +8,16 @@ var __assign = this && this.__assign || function () {
17
8
  };
18
9
  return __assign.apply(this, arguments);
19
10
  };
11
+ /*
12
+ * @Author: shenzhiwei
13
+ * @Date: 2021-03-28 14:19:34
14
+ * @Company: orientsec.com.cn
15
+ * @Description: UI交互上的最终处理 chain
16
+ */
17
+ // import { removeStorageSync } from "fastman3-dfyjapp-syncstorage";
18
+ // import { TOKEN_KEY } from "../constants";
19
+ import { storeToken } from "../utils";
20
+ import { isFromWeiXin } from "fastman3-common-helper/es/OS.h5";
20
21
  var endProductInterceptor = function endProductInterceptor(chain) {
21
22
  var requestParams = chain.requestParams;
22
23
  if (requestParams === null || requestParams === void 0 ? void 0 : requestParams.isNative) return chain.proceed(requestParams);
@@ -30,7 +31,7 @@ var endProductInterceptor = function endProductInterceptor(chain) {
30
31
  var code = payload.code,
31
32
  info = payload.info,
32
33
  data = payload.data;
33
- // const tempToken = header.token;
34
+ var tempToken = header.token;
34
35
  // token 不暴露给上层
35
36
  header.token = "***";
36
37
  // restful 接口==>自定义字段RESTFUL_PATH_BY_FASTMAN3存在时重新赋值赋值
@@ -49,6 +50,10 @@ var endProductInterceptor = function endProductInterceptor(chain) {
49
50
  } else {
50
51
  // // 本地存储或覆盖token
51
52
  // storeToken(tempToken);
53
+ // 2026-4-15:微信的token保存到localStorage
54
+ if (isFromWeiXin()) {
55
+ storeToken(tempToken);
56
+ }
52
57
  }
53
58
  return __assign({
54
59
  header: header
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastman3-dfyjapp-request",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "a network request for dfyj app",
5
5
  "prepublishOnly": "npm run build",
6
6
  "main": "es/request.js",