dfws-ve-taro-request 0.1.5 → 0.1.7

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/dist/index.js CHANGED
@@ -6819,7 +6819,7 @@ var checkStatus = function (response, options, Taro) {
6819
6819
  return data;
6820
6820
  }
6821
6821
  var type = response.header['Content-Type'] || response.header['content-type'] || '';
6822
- if (typeof data.status == 'undefined' && !type.includes('text/html')) {
6822
+ if (typeof data.status == 'undefined' && (type && !type.includes('text/html'))) {
6823
6823
  data.status = 1;
6824
6824
  data.errMsg = "";
6825
6825
  }
@@ -6856,14 +6856,7 @@ var request = (function (url, data, method, header, Taro, debug) {
6856
6856
  data: isMethod ? {} : isEncode ? encryptByDES(data, debug) : data,
6857
6857
  method: method,
6858
6858
  timeout: 15000,
6859
- header: {
6860
- 'authorization': Taro.getStorageSync('ticket'),
6861
- 've-version': header.version || '1.0.0',
6862
- 'dfws-params': header.params || '',
6863
- 'content-type': header["content-type"] || 'application/json;charset=utf-8',
6864
- 'resume-language': header['resume-language'] || 'zh-CN',
6865
- 'common-params': header['common-params'] || '',
6866
- }
6859
+ header: __assign(__assign({ 'authorization': Taro.getStorageSync('ticket') }, header), { 've-version': header.version || '1.0.0', 'dfws-params': header.params || '', 'content-type': header["content-type"] || 'application/json;charset=utf-8', 'resume-language': header['resume-language'] || 'zh-CN', 'common-params': header['common-params'] || '' })
6867
6860
  }).then(function (res) {
6868
6861
  var response = isEncode ? __assign(__assign({}, res), { data: decryptByDES(unescape(res.data), debug) }) : res;
6869
6862
  return checkStatus(response, { url: url, data: data, method: method }, Taro);