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 +8 -0
- package/es/interceptors/transformInterceptor.js +2 -1
- package/es/request.js +11 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,7 +61,8 @@ var transformInterceptor = function transformInterceptor(chain) {
|
|
|
61
61
|
body.header["token"] = tokenStorage;
|
|
62
62
|
}
|
|
63
63
|
// 非APP增加deviceId属性,APP则使用vtDeviceId属性。
|
|
64
|
-
|
|
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
|
}
|