dlt-for-react 1.0.11 → 1.0.12

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
@@ -1,6 +1,6 @@
1
1
  #### 安装
2
2
 
3
- cnpm install dlt-for-react --save
3
+ npm install dlt-for-react --save
4
4
 
5
5
  #### 发布
6
6
 
@@ -8,14 +8,18 @@ npm publish
8
8
 
9
9
  ## 前端 dlt-for-react 依赖包版本更新记录
10
10
 
11
- ##### 当前最新版本:1.0.10
11
+ ##### 当前最新版本:1.0.12
12
12
 
13
13
  ##### 安装依赖
14
14
 
15
- > cnpm install dlt-for-react --save
15
+ > npm install dlt-for-react --save
16
16
 
17
17
  ##### 版本修改记录
18
18
 
19
+ #### V1.0.11—2023 年 10 月 23 日
20
+
21
+ 1. 优化 NHFetch 支持文件上传模式兼容请求头配置 FormData
22
+
19
23
  #### V1.0.11—2023 年 10 月 20 日
20
24
 
21
25
  1. 将 zhxg 服务修改未 hq 服务
@@ -268,15 +268,22 @@ var NHFetch = function NHFetch(pUrl, pMethod, params, errorFunc) {
268
268
  method = 'POST';
269
269
  tmpHeader = 'application/json;charset=UTF-8';
270
270
  if (params !== undefined && params !== '') {
271
- opts.body = (0, _stringify2.default)(params);
271
+ if (params.constructor === FormData) {
272
+ opts.body = params;
273
+ } else {
274
+ opts.body = (0, _stringify2.default)(params);
275
+ }
272
276
  }
273
277
  }
274
278
  opts.method = method;
275
279
  // credentials: 'include',
276
- opts.headers = { 'Content-Type': tmpHeader
280
+ opts.headers = { 'Content-Type': tmpHeader };
281
+ if (params && params.constructor === FormData) {
282
+ opts.headers = {};
283
+ }
277
284
 
278
- //设置网关加密串
279
- };var timestemp = new Date().valueOf();
285
+ //设置网关加密串
286
+ var timestemp = new Date().valueOf();
280
287
  var csrfToken = (0, _MD.hex_md5)('timestamp=' + timestemp + ',key=' + 'lianyi2019' //这个就是与网关约定的秘钥
281
288
  );
282
289
  if (url.indexOf('?') > -1 && url.indexOf('=') > -1 && url.indexOf('?') < url.indexOf('=')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlt-for-react",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "dlt for react",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {