zmdms-utils 0.0.71 → 0.0.73

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.
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 对称加密和hash
3
+ */
1
4
  declare class Crypto {
2
5
  private aesKey;
3
6
  private desKey;
package/dist/es/crypto.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import CryptoJS from 'crypto-js';
2
+ export { Base64 } from './node_modules/js-base64/base64.js';
2
3
 
4
+ /**
5
+ * 对称加密和hash
6
+ */
3
7
  var Crypto = /** @class */ (function () {
4
8
  function Crypto(aesKey, desKey) {
5
9
  this.aesKey = aesKey;
@@ -0,0 +1,273 @@
1
+ /**
2
+ * base64.ts
3
+ *
4
+ * Licensed under the BSD 3-Clause License.
5
+ * http://opensource.org/licenses/BSD-3-Clause
6
+ *
7
+ * References:
8
+ * http://en.wikipedia.org/wiki/Base64
9
+ *
10
+ * @author Dan Kogai (https://github.com/dankogai)
11
+ */
12
+ const version = '3.7.7';
13
+ /**
14
+ * @deprecated use lowercase `version`.
15
+ */
16
+ const VERSION = version;
17
+ const _hasBuffer = typeof Buffer === 'function';
18
+ const _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
19
+ const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
20
+ const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
21
+ const b64chs = Array.prototype.slice.call(b64ch);
22
+ const b64tab = ((a) => {
23
+ let tab = {};
24
+ a.forEach((c, i) => tab[c] = i);
25
+ return tab;
26
+ })(b64chs);
27
+ const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
28
+ const _fromCC = String.fromCharCode.bind(String);
29
+ const _U8Afrom = typeof Uint8Array.from === 'function'
30
+ ? Uint8Array.from.bind(Uint8Array)
31
+ : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
32
+ const _mkUriSafe = (src) => src
33
+ .replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
34
+ const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
35
+ /**
36
+ * polyfill version of `btoa`
37
+ */
38
+ const btoaPolyfill = (bin) => {
39
+ // console.log('polyfilled');
40
+ let u32, c0, c1, c2, asc = '';
41
+ const pad = bin.length % 3;
42
+ for (let i = 0; i < bin.length;) {
43
+ if ((c0 = bin.charCodeAt(i++)) > 255 ||
44
+ (c1 = bin.charCodeAt(i++)) > 255 ||
45
+ (c2 = bin.charCodeAt(i++)) > 255)
46
+ throw new TypeError('invalid character found');
47
+ u32 = (c0 << 16) | (c1 << 8) | c2;
48
+ asc += b64chs[u32 >> 18 & 63]
49
+ + b64chs[u32 >> 12 & 63]
50
+ + b64chs[u32 >> 6 & 63]
51
+ + b64chs[u32 & 63];
52
+ }
53
+ return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
54
+ };
55
+ /**
56
+ * does what `window.btoa` of web browsers do.
57
+ * @param {String} bin binary string
58
+ * @returns {string} Base64-encoded string
59
+ */
60
+ const _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)
61
+ : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')
62
+ : btoaPolyfill;
63
+ const _fromUint8Array = _hasBuffer
64
+ ? (u8a) => Buffer.from(u8a).toString('base64')
65
+ : (u8a) => {
66
+ // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
67
+ const maxargs = 0x1000;
68
+ let strs = [];
69
+ for (let i = 0, l = u8a.length; i < l; i += maxargs) {
70
+ strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
71
+ }
72
+ return _btoa(strs.join(''));
73
+ };
74
+ /**
75
+ * converts a Uint8Array to a Base64 string.
76
+ * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
77
+ * @returns {string} Base64 string
78
+ */
79
+ const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
80
+ // This trick is found broken https://github.com/dankogai/js-base64/issues/130
81
+ // const utob = (src: string) => unescape(encodeURIComponent(src));
82
+ // reverting good old fationed regexp
83
+ const cb_utob = (c) => {
84
+ if (c.length < 2) {
85
+ var cc = c.charCodeAt(0);
86
+ return cc < 0x80 ? c
87
+ : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
88
+ + _fromCC(0x80 | (cc & 0x3f)))
89
+ : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
90
+ + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
91
+ + _fromCC(0x80 | (cc & 0x3f)));
92
+ }
93
+ else {
94
+ var cc = 0x10000
95
+ + (c.charCodeAt(0) - 0xD800) * 0x400
96
+ + (c.charCodeAt(1) - 0xDC00);
97
+ return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
98
+ + _fromCC(0x80 | ((cc >>> 12) & 0x3f))
99
+ + _fromCC(0x80 | ((cc >>> 6) & 0x3f))
100
+ + _fromCC(0x80 | (cc & 0x3f)));
101
+ }
102
+ };
103
+ const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
104
+ /**
105
+ * @deprecated should have been internal use only.
106
+ * @param {string} src UTF-8 string
107
+ * @returns {string} UTF-16 string
108
+ */
109
+ const utob = (u) => u.replace(re_utob, cb_utob);
110
+ //
111
+ const _encode = _hasBuffer
112
+ ? (s) => Buffer.from(s, 'utf8').toString('base64')
113
+ : _TE
114
+ ? (s) => _fromUint8Array(_TE.encode(s))
115
+ : (s) => _btoa(utob(s));
116
+ /**
117
+ * converts a UTF-8-encoded string to a Base64 string.
118
+ * @param {boolean} [urlsafe] if `true` make the result URL-safe
119
+ * @returns {string} Base64 string
120
+ */
121
+ const encode = (src, urlsafe = false) => urlsafe
122
+ ? _mkUriSafe(_encode(src))
123
+ : _encode(src);
124
+ /**
125
+ * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
126
+ * @returns {string} Base64 string
127
+ */
128
+ const encodeURI = (src) => encode(src, true);
129
+ // This trick is found broken https://github.com/dankogai/js-base64/issues/130
130
+ // const btou = (src: string) => decodeURIComponent(escape(src));
131
+ // reverting good old fationed regexp
132
+ const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
133
+ const cb_btou = (cccc) => {
134
+ switch (cccc.length) {
135
+ case 4:
136
+ var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
137
+ | ((0x3f & cccc.charCodeAt(1)) << 12)
138
+ | ((0x3f & cccc.charCodeAt(2)) << 6)
139
+ | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
140
+ return (_fromCC((offset >>> 10) + 0xD800)
141
+ + _fromCC((offset & 0x3FF) + 0xDC00));
142
+ case 3:
143
+ return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
144
+ | ((0x3f & cccc.charCodeAt(1)) << 6)
145
+ | (0x3f & cccc.charCodeAt(2)));
146
+ default:
147
+ return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
148
+ | (0x3f & cccc.charCodeAt(1)));
149
+ }
150
+ };
151
+ /**
152
+ * @deprecated should have been internal use only.
153
+ * @param {string} src UTF-16 string
154
+ * @returns {string} UTF-8 string
155
+ */
156
+ const btou = (b) => b.replace(re_btou, cb_btou);
157
+ /**
158
+ * polyfill version of `atob`
159
+ */
160
+ const atobPolyfill = (asc) => {
161
+ // console.log('polyfilled');
162
+ asc = asc.replace(/\s+/g, '');
163
+ if (!b64re.test(asc))
164
+ throw new TypeError('malformed base64.');
165
+ asc += '=='.slice(2 - (asc.length & 3));
166
+ let u24, bin = '', r1, r2;
167
+ for (let i = 0; i < asc.length;) {
168
+ u24 = b64tab[asc.charAt(i++)] << 18
169
+ | b64tab[asc.charAt(i++)] << 12
170
+ | (r1 = b64tab[asc.charAt(i++)]) << 6
171
+ | (r2 = b64tab[asc.charAt(i++)]);
172
+ bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)
173
+ : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)
174
+ : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);
175
+ }
176
+ return bin;
177
+ };
178
+ /**
179
+ * does what `window.atob` of web browsers do.
180
+ * @param {String} asc Base64-encoded string
181
+ * @returns {string} binary string
182
+ */
183
+ const _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))
184
+ : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')
185
+ : atobPolyfill;
186
+ //
187
+ const _toUint8Array = _hasBuffer
188
+ ? (a) => _U8Afrom(Buffer.from(a, 'base64'))
189
+ : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
190
+ /**
191
+ * converts a Base64 string to a Uint8Array.
192
+ */
193
+ const toUint8Array = (a) => _toUint8Array(_unURI(a));
194
+ //
195
+ const _decode = _hasBuffer
196
+ ? (a) => Buffer.from(a, 'base64').toString('utf8')
197
+ : _TD
198
+ ? (a) => _TD.decode(_toUint8Array(a))
199
+ : (a) => btou(_atob(a));
200
+ const _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));
201
+ /**
202
+ * converts a Base64 string to a UTF-8 string.
203
+ * @param {String} src Base64 string. Both normal and URL-safe are supported
204
+ * @returns {string} UTF-8 string
205
+ */
206
+ const decode = (src) => _decode(_unURI(src));
207
+ /**
208
+ * check if a value is a valid Base64 string
209
+ * @param {String} src a value to check
210
+ */
211
+ const isValid = (src) => {
212
+ if (typeof src !== 'string')
213
+ return false;
214
+ const s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
215
+ return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
216
+ };
217
+ //
218
+ const _noEnum = (v) => {
219
+ return {
220
+ value: v, enumerable: false, writable: true, configurable: true
221
+ };
222
+ };
223
+ /**
224
+ * extend String.prototype with relevant methods
225
+ */
226
+ const extendString = function () {
227
+ const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));
228
+ _add('fromBase64', function () { return decode(this); });
229
+ _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });
230
+ _add('toBase64URI', function () { return encode(this, true); });
231
+ _add('toBase64URL', function () { return encode(this, true); });
232
+ _add('toUint8Array', function () { return toUint8Array(this); });
233
+ };
234
+ /**
235
+ * extend Uint8Array.prototype with relevant methods
236
+ */
237
+ const extendUint8Array = function () {
238
+ const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));
239
+ _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });
240
+ _add('toBase64URI', function () { return fromUint8Array(this, true); });
241
+ _add('toBase64URL', function () { return fromUint8Array(this, true); });
242
+ };
243
+ /**
244
+ * extend Builtin prototypes with relevant methods
245
+ */
246
+ const extendBuiltins = () => {
247
+ extendString();
248
+ extendUint8Array();
249
+ };
250
+ const gBase64 = {
251
+ version: version,
252
+ VERSION: VERSION,
253
+ atob: _atob,
254
+ atobPolyfill: atobPolyfill,
255
+ btoa: _btoa,
256
+ btoaPolyfill: btoaPolyfill,
257
+ fromBase64: decode,
258
+ toBase64: encode,
259
+ encode: encode,
260
+ encodeURI: encodeURI,
261
+ encodeURL: encodeURI,
262
+ utob: utob,
263
+ btou: btou,
264
+ decode: decode,
265
+ isValid: isValid,
266
+ fromUint8Array: fromUint8Array,
267
+ toUint8Array: toUint8Array,
268
+ extendString: extendString,
269
+ extendUint8Array: extendUint8Array,
270
+ extendBuiltins: extendBuiltins
271
+ };
272
+
273
+ export { gBase64 as Base64, VERSION, _atob as atob, atobPolyfill, _btoa as btoa, btoaPolyfill, btou, decode, encode, encodeURI, encodeURI as encodeURL, extendBuiltins, extendString, extendUint8Array, decode as fromBase64, fromUint8Array, isValid, encode as toBase64, toUint8Array, utob, version };
@@ -14,6 +14,7 @@ declare class AxiosRequest {
14
14
  private messageWarning?;
15
15
  private modalConfirm?;
16
16
  private instanceAxios;
17
+ private tokenKey;
17
18
  constructor(otherOptions: IOtherOptions);
18
19
  private defaultSetting;
19
20
  private interceptorsRequest;
@@ -56,7 +57,7 @@ interface IOtherOptions {
56
57
  /** 提示方法 外部传入 */
57
58
  messageWarning?: (msg: string, duration: number, callback?: () => void) => void;
58
59
  modalConfirm?: (msg: string, callback?: () => void) => void;
59
- /** token相关值 */
60
+ /** @deprecated 租户ID,只有登录接口 需要 传递。 */
60
61
  TenantId?: string;
61
62
  /** auth值 */
62
63
  Authorization?: string;
@@ -64,6 +65,8 @@ interface IOtherOptions {
64
65
  commonHeaders?: {
65
66
  [prop: string]: any;
66
67
  };
68
+ /** 请求认证TOKEN KEY */
69
+ tokenKey?: string;
67
70
  /** 超时时间 */
68
71
  timeout?: number;
69
72
  /** 基础url */
@@ -4,7 +4,7 @@ import { removeToken, getToken } from './auth.js';
4
4
  import { TOKEN_KEY } from './constants.js';
5
5
 
6
6
  var defaultOptions = {
7
- TenantId: "000000",
7
+ // TenantId: "000000", // 租户ID不需要了
8
8
  Authorization: "Basic em1kbXM6em1kbXNfc2VjcmV0",
9
9
  timeout: 60000,
10
10
  };
@@ -20,9 +20,12 @@ var AxiosRequest = /** @class */ (function () {
20
20
  this.isTimeout = false;
21
21
  // axios单例
22
22
  this.instanceAxios = axios.create();
23
- var crypto = otherOptions.crypto, jumpCallback = otherOptions.jumpCallback, isTimeoutConfirm = otherOptions.isTimeoutConfirm, isTimeoutConfirmStr = otherOptions.isTimeoutConfirmStr, messageWarning = otherOptions.messageWarning, modalConfirm = otherOptions.modalConfirm, resetOtherOptions = __rest(otherOptions, ["crypto", "jumpCallback", "isTimeoutConfirm", "isTimeoutConfirmStr", "messageWarning", "modalConfirm"]);
23
+ // tokenKey
24
+ this.tokenKey = TOKEN_KEY;
25
+ var crypto = otherOptions.crypto, jumpCallback = otherOptions.jumpCallback, isTimeoutConfirm = otherOptions.isTimeoutConfirm, isTimeoutConfirmStr = otherOptions.isTimeoutConfirmStr, messageWarning = otherOptions.messageWarning, modalConfirm = otherOptions.modalConfirm, tokenKey = otherOptions.tokenKey, resetOtherOptions = __rest(otherOptions, ["crypto", "jumpCallback", "isTimeoutConfirm", "isTimeoutConfirmStr", "messageWarning", "modalConfirm", "tokenKey"]);
24
26
  this.otherOptions = __assign(__assign({}, defaultOptions), resetOtherOptions);
25
27
  this.crypto = crypto;
28
+ this.tokenKey = tokenKey || TOKEN_KEY;
26
29
  this.isTimeoutConfirm = isTimeoutConfirm;
27
30
  this.isTimeoutConfirmStr = isTimeoutConfirmStr;
28
31
  this.jumpCallback = jumpCallback;
@@ -36,8 +39,9 @@ var AxiosRequest = /** @class */ (function () {
36
39
  AxiosRequest.prototype.defaultSetting = function () {
37
40
  var _this = this;
38
41
  // 设置默认请求头
39
- this.instanceAxios.defaults.headers.common["Tenant-Id"] =
40
- this.otherOptions.TenantId;
42
+ // 租户ID只有登录的时候才需要传递
43
+ // this.instanceAxios.defaults.headers.common["Tenant-Id"] =
44
+ // this.otherOptions.TenantId;
41
45
  this.instanceAxios.defaults.headers.common["Authorization"] =
42
46
  this.otherOptions.Authorization;
43
47
  if (this.otherOptions.commonHeaders) {
@@ -226,7 +230,7 @@ var AxiosRequest = /** @class */ (function () {
226
230
  }
227
231
  if (isAuth) {
228
232
  var token = getToken();
229
- newOptions.headers[TOKEN_KEY] = "bearer ".concat(token);
233
+ newOptions.headers[this.tokenKey] = "bearer ".concat(token);
230
234
  }
231
235
  // 遍历params,将undefined值 转为null值
232
236
  if (newOptions.data) {
package/dist/index.d.ts CHANGED
@@ -18,3 +18,4 @@ export { imgToPdf } from './es/pdf.js';
18
18
  export { htmlToPdf } from './es/htmlToPdf.js';
19
19
  export { htmlPrint, imgPrint, pdfPrint, windowPrint } from './es/print.js';
20
20
  export { createWater, getDefaultContent, mergeWaterConfig } from './es/water.js';
21
+ export { Base64 } from 'js-base64';
package/dist/index.js CHANGED
@@ -18,3 +18,4 @@ export { imgToPdf } from './es/pdf.js';
18
18
  export { htmlToPdf } from './es/htmlToPdf.js';
19
19
  export { htmlPrint, imgPrint, pdfPrint, windowPrint } from './es/print.js';
20
20
  export { createWater, getDefaultContent, mergeWaterConfig } from './es/water.js';
21
+ export { Base64 } from './es/node_modules/js-base64/base64.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-utils",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -34,6 +34,7 @@
34
34
  "@types/crypto-js": "^4.1.1",
35
35
  "axios": "^1.4.0",
36
36
  "crypto-js": "^4.1.1",
37
+ "js-base64": "^3.7.7",
37
38
  "dayjs": "^1.11.10",
38
39
  "html2canvas": "^1.4.1",
39
40
  "jspdf": "^2.5.1",
package/src/crypto.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import CryptoJS from "crypto-js";
2
+ import { Base64 } from "js-base64";
2
3
 
4
+ /**
5
+ * 对称加密和hash
6
+ */
3
7
  export class Crypto {
4
8
  // 使用AesUtil.genAesKey()生成,需和后端配置保持一致
5
9
  private aesKey: string;
@@ -107,3 +111,5 @@ export class Crypto {
107
111
  }
108
112
 
109
113
  export const md5 = (str: string) => CryptoJS.MD5(str).toString().toLowerCase();
114
+
115
+ export { Base64 };
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ export { initMainApp, initGlobalError } from "./mainApp";
4
4
  export { getToken, setToken, removeToken, parseToken } from "./auth";
5
5
  export { AxiosRequest, type IOtherOptions, type IOptions } from "./request";
6
6
  export { getBaseUrl } from "./baseUrl";
7
- export { Crypto, md5 } from "./crypto";
7
+ export { Crypto, md5, Base64 } from "./crypto";
8
8
  export {
9
9
  delay,
10
10
  emitter,
package/src/request.ts CHANGED
@@ -10,7 +10,7 @@ import { Crypto } from "./crypto";
10
10
  import { TOKEN_KEY } from "./constants";
11
11
 
12
12
  const defaultOptions: IOtherOptions = {
13
- TenantId: "000000",
13
+ // TenantId: "000000", // 租户ID不需要了
14
14
  Authorization: "Basic em1kbXM6em1kbXNfc2VjcmV0",
15
15
  timeout: 60000,
16
16
  };
@@ -36,6 +36,8 @@ export class AxiosRequest {
36
36
  private modalConfirm?: IOtherOptions["modalConfirm"];
37
37
  // axios单例
38
38
  private instanceAxios: AxiosInstance = axios.create();
39
+ // tokenKey
40
+ private tokenKey: string = TOKEN_KEY;
39
41
 
40
42
  constructor(otherOptions: IOtherOptions) {
41
43
  const {
@@ -45,10 +47,12 @@ export class AxiosRequest {
45
47
  isTimeoutConfirmStr,
46
48
  messageWarning,
47
49
  modalConfirm,
50
+ tokenKey,
48
51
  ...resetOtherOptions
49
52
  } = otherOptions;
50
53
  this.otherOptions = { ...defaultOptions, ...resetOtherOptions };
51
54
  this.crypto = crypto;
55
+ this.tokenKey = tokenKey || TOKEN_KEY;
52
56
  this.isTimeoutConfirm = isTimeoutConfirm;
53
57
  this.isTimeoutConfirmStr = isTimeoutConfirmStr;
54
58
  this.jumpCallback = jumpCallback;
@@ -62,8 +66,9 @@ export class AxiosRequest {
62
66
  // 设置axios方法默认值
63
67
  private defaultSetting() {
64
68
  // 设置默认请求头
65
- this.instanceAxios.defaults.headers.common["Tenant-Id"] =
66
- this.otherOptions.TenantId;
69
+ // 租户ID只有登录的时候才需要传递
70
+ // this.instanceAxios.defaults.headers.common["Tenant-Id"] =
71
+ // this.otherOptions.TenantId;
67
72
  this.instanceAxios.defaults.headers.common["Authorization"] =
68
73
  this.otherOptions.Authorization;
69
74
 
@@ -275,7 +280,7 @@ export class AxiosRequest {
275
280
  }
276
281
  if (isAuth) {
277
282
  const token = getToken();
278
- newOptions.headers[TOKEN_KEY] = `bearer ${token}`;
283
+ newOptions.headers[this.tokenKey] = `bearer ${token}`;
279
284
  }
280
285
 
281
286
  // 遍历params,将undefined值 转为null值
@@ -402,12 +407,14 @@ export interface IOtherOptions {
402
407
  callback?: () => void
403
408
  ) => void;
404
409
  modalConfirm?: (msg: string, callback?: () => void) => void;
405
- /** token相关值 */
410
+ /** @deprecated 租户ID,只有登录接口 需要 传递。 */
406
411
  TenantId?: string;
407
412
  /** auth值 */
408
413
  Authorization?: string;
409
414
  /** 公用请求头 */
410
415
  commonHeaders?: { [prop: string]: any };
416
+ /** 请求认证TOKEN KEY */
417
+ tokenKey?: string;
411
418
  /** 超时时间 */
412
419
  timeout?: number;
413
420
  /** 基础url */