uniapp-request-sdk 1.3.7 → 1.3.8

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.
Files changed (2) hide show
  1. package/dist/index.esm.js +3 -15
  2. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -20,20 +20,6 @@ function _createClass(Constructor, protoProps, staticProps) {
20
20
  });
21
21
  return Constructor;
22
22
  }
23
- function _defineProperty(obj, key, value) {
24
- key = _toPropertyKey(key);
25
- if (key in obj) {
26
- Object.defineProperty(obj, key, {
27
- value: value,
28
- enumerable: true,
29
- configurable: true,
30
- writable: true
31
- });
32
- } else {
33
- obj[key] = value;
34
- }
35
- return obj;
36
- }
37
23
  function _toPrimitive(input, hint) {
38
24
  if (typeof input !== "object" || input === null) return input;
39
25
  var prim = input[Symbol.toPrimitive];
@@ -124,11 +110,13 @@ var UniRequest = /*#__PURE__*/function () {
124
110
  } else {
125
111
  url = "".concat(params.url, "?t=").concat(Date.now());
126
112
  }
127
- var header = Object.assign(Object.assign(Object.assign({}, this.header), params.header), _defineProperty({}, this.tokenHeader, "".concat(this.tokenPrefix).concat(this.token)));
113
+ var header = Object.assign(Object.assign({}, this.header), params.header);
128
114
  var requestedToken = false;
129
115
  var retryCount = 0;
130
116
  return new Promise(function (res, rej) {
131
117
  var retryFucntion = function retryFucntion() {
118
+ /** 因为token需要动态获取,因此放入这里 */
119
+ header[_this3.tokenHeader] = "".concat(_this3.tokenPrefix).concat(_this3.token);
132
120
  requestPromise(Object.assign(Object.assign({}, params), {
133
121
  header: header,
134
122
  url: url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniapp-request-sdk",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "用于uniapp小程序的请求库的sdk",
5
5
  "main": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",