fastman3-dfyjapp-request 1.1.13 → 1.1.15

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
@@ -111,3 +111,11 @@
111
111
  ### v 1.1.13 - 2025.02.14
112
112
 
113
113
  1. 针对restful请求 中台报错返回500,进行特殊处理
114
+
115
+ ### v 1.1.14 - 2025.02.14
116
+
117
+ 1. 针对restful请求 调用时添加拦截器
118
+
119
+ ### v 1.1.15 - 2025.03.14
120
+
121
+ 1. 通讯层设备号增加__POWERED_BY_DFGJAPP__识别
@@ -61,7 +61,8 @@ var transformInterceptor = function transformInterceptor(chain) {
61
61
  body.header["token"] = tokenStorage;
62
62
  }
63
63
  // 非APP增加deviceId属性,APP则使用vtDeviceId属性。
64
- if (!isFromApp()) {
64
+ // @ts-ignore
65
+ if (!isFromApp() || __POWERED_BY_DFGJAPP__) {
65
66
  // 增加opstation属性
66
67
  body.header["opStation"] = "33333333333";
67
68
  // 微信接入时opStation设置为微信的OpenID
package/es/request.js CHANGED
@@ -164,6 +164,17 @@ var fetch = /** @class */function () {
164
164
  * @param data 数据,对象类型
165
165
  */
166
166
  fetch.prototype.postRouter = function (restfulPath, data) {
167
+ if (!this.init) {
168
+ addInterceptor(endProductInterceptor);
169
+ addInterceptor(transformInterceptor);
170
+ addInterceptor(logInterceptor);
171
+ if (process.env.APP_ENV !== "mock") {
172
+ addInterceptor(securityInterceptor);
173
+ }
174
+ addInterceptor(httpStatusInterceptor);
175
+ addInterceptor(timeoutInterceptor);
176
+ this.init = true;
177
+ }
167
178
  if (typeof data != "string") {
168
179
  data = JSON.stringify(data);
169
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastman3-dfyjapp-request",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "a network request for dfyj app",
5
5
  "prepublishOnly": "npm run build",
6
6
  "main": "es/request.js",