tools-min-ns 1.18.0 → 1.18.4
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 +10 -0
- package/esm/array/TreeUtil.js +1 -1
- package/esm/check/CheckUtil.d.ts +1 -1
- package/esm/check/CheckUtil.js +11 -1
- package/esm/func/FunctionUtil.d.ts +2 -2
- package/esm/request/RequestUtil.d.ts +19 -7
- package/esm/request/RequestUtil.js +32 -0
- package/lib/array/TreeUtil.js +1 -1
- package/lib/check/CheckUtil.d.ts +1 -1
- package/lib/check/CheckUtil.js +11 -1
- package/lib/func/FunctionUtil.d.ts +2 -2
- package/lib/request/RequestUtil.d.ts +19 -7
- package/lib/request/RequestUtil.js +32 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/esm/array/TreeUtil.js
CHANGED
|
@@ -390,7 +390,7 @@ var TreeUtil;
|
|
|
390
390
|
var _a, _b, _c;
|
|
391
391
|
item[parent] = "".concat((_a = parentData === null || parentData === void 0 ? void 0 : parentData[parent]) !== null && _a !== void 0 ? _a : '', "/").concat((_b = parentData === null || parentData === void 0 ? void 0 : parentData[label]) !== null && _b !== void 0 ? _b : '');
|
|
392
392
|
if (parentData && !((_c = item === null || item === void 0 ? void 0 : item[children]) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
393
|
-
strArr.push("".concat(item[parent], "/").concat(item[label]).split(
|
|
393
|
+
strArr.push("".concat(item[parent], "/").concat(item[label]).split('/').filter(function (e) {
|
|
394
394
|
return e;
|
|
395
395
|
}).join(splitStr));
|
|
396
396
|
}
|
package/esm/check/CheckUtil.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ console.log(isValidFileName("invalid:name.txt")); // false
|
|
|
110
110
|
* @param type 类型
|
|
111
111
|
* @param options
|
|
112
112
|
*/
|
|
113
|
-
function getFormItemRules(type: StrType, options?: {
|
|
113
|
+
function getFormItemRules(type: StrType | 'MOBILE_AES' | 'ID_CARD_AES', options?: {
|
|
114
114
|
label?: string;
|
|
115
115
|
required?: boolean;
|
|
116
116
|
errMsg?: string;
|
package/esm/check/CheckUtil.js
CHANGED
|
@@ -150,6 +150,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
150
150
|
* @author nanshen
|
|
151
151
|
* @creat 2021-09-15 10:30:46
|
|
152
152
|
*/
|
|
153
|
+
import PasswordUtil from '../pwd/PasswordUtil';
|
|
153
154
|
import BaseUtil from '../base/BaseUtil';
|
|
154
155
|
import { STR_TYPE } from '../common';
|
|
155
156
|
var CheckUtil;
|
|
@@ -519,7 +520,16 @@ var CheckUtil;
|
|
|
519
520
|
validator: function validator(_, value, c) {
|
|
520
521
|
return __awaiter(_this, void 0, void 0, function () {
|
|
521
522
|
return __generator(this, function (_a) {
|
|
522
|
-
if (!value
|
|
523
|
+
if (!value) return [2 /*return*/, Promise.resolve()];
|
|
524
|
+
if (type === 'MOBILE_AES') {
|
|
525
|
+
if (CheckUtil.checkAny(PasswordUtil.strDecrypt(value), 'MOBILE')) return [2 /*return*/, Promise.resolve()];
|
|
526
|
+
return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u8F93\u5165\u6B63\u786E\u7684".concat(msg, "\uFF01")))];
|
|
527
|
+
}
|
|
528
|
+
if (type === 'ID_CARD_AES') {
|
|
529
|
+
if (CheckUtil.checkAny(PasswordUtil.strDecrypt(value), 'ID_CARD')) return [2 /*return*/, Promise.resolve()];
|
|
530
|
+
return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u8F93\u5165\u6B63\u786E\u7684".concat(msg, "\uFF01")))];
|
|
531
|
+
}
|
|
532
|
+
if (CheckUtil.checkAny(value, type)) return [2 /*return*/, Promise.resolve()];
|
|
523
533
|
if (type === 'LOGIN_NAME') {
|
|
524
534
|
return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "".concat(msg, "\u53EA\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u6216\u51CF\u53F7\uFF1B\u9996\u5B57\u6BCD\u5FC5\u987B\u4E3A\u5B57\u6BCD\uFF1B\u957F\u5EA6\u4E3A6-18\u4E2A\u5B57\u7B26\uFF1B\u4E0D\u80FD\u5305\u542B\u7279\u6B8A\u5B57\u7B26")))];
|
|
525
535
|
}
|
|
@@ -34,7 +34,7 @@ declare namespace FunctionUtil {
|
|
|
34
34
|
* query()
|
|
35
35
|
* query() => 3
|
|
36
36
|
*/
|
|
37
|
-
function debounceFn<T extends
|
|
37
|
+
function debounceFn<T extends Function>(fn: T, t?: number, immediate?: boolean): T;
|
|
38
38
|
/**
|
|
39
39
|
* 函数节流
|
|
40
40
|
* @param fn 需要节流的函数
|
|
@@ -45,7 +45,7 @@ declare namespace FunctionUtil {
|
|
|
45
45
|
* query()
|
|
46
46
|
* query()
|
|
47
47
|
*/
|
|
48
|
-
function throttleFn<T extends
|
|
48
|
+
function throttleFn<T extends Function>(fn: T, t?: number): T;
|
|
49
49
|
/**
|
|
50
50
|
* 函数只能调用一次
|
|
51
51
|
* @param { Function } fn 需要被处理的函数
|
|
@@ -11,9 +11,9 @@ import nsPromiseFn from './nsPromiseFn';
|
|
|
11
11
|
export type PromiseInput<T> = Array<(() => Promise<T>) | Promise<T>> | (() => Promise<T>) | Promise<T>;
|
|
12
12
|
declare namespace RequestUtil {
|
|
13
13
|
/** @name 浙里办请求工具设置默认请求头 */
|
|
14
|
-
const mgopSetDefaultHeader: typeof setDefaultHeader;
|
|
14
|
+
export const mgopSetDefaultHeader: typeof setDefaultHeader;
|
|
15
15
|
/** @name 浙里办请求工具 */
|
|
16
|
-
const mgopRequest: typeof mgop;
|
|
16
|
+
export const mgopRequest: typeof mgop;
|
|
17
17
|
/**
|
|
18
18
|
* @name 简单发起请求
|
|
19
19
|
* @example
|
|
@@ -30,7 +30,7 @@ declare namespace RequestUtil {
|
|
|
30
30
|
dataType: 'json'
|
|
31
31
|
}).then(response => {}).catch(error => {});
|
|
32
32
|
*/
|
|
33
|
-
const uniRquest: typeof uniRquestFn;
|
|
33
|
+
export const uniRquest: typeof uniRquestFn;
|
|
34
34
|
/**
|
|
35
35
|
* @name jsonp请求工具
|
|
36
36
|
@example
|
|
@@ -41,7 +41,7 @@ declare namespace RequestUtil {
|
|
|
41
41
|
//...
|
|
42
42
|
});
|
|
43
43
|
*/
|
|
44
|
-
const jsonp: typeof jsonpFn;
|
|
44
|
+
export const jsonp: typeof jsonpFn;
|
|
45
45
|
/**
|
|
46
46
|
* @name jsonpRquest请求工具
|
|
47
47
|
@example
|
|
@@ -49,14 +49,14 @@ declare namespace RequestUtil {
|
|
|
49
49
|
url: 'https:/xxxx.com?key=1&output=jsonp'
|
|
50
50
|
}).then(response => {}).catch(error => {});
|
|
51
51
|
*/
|
|
52
|
-
const jsonpRquest: typeof jsonpRquestFn;
|
|
52
|
+
export const jsonpRquest: typeof jsonpRquestFn;
|
|
53
53
|
/**
|
|
54
54
|
* 异步请求并发处理
|
|
55
55
|
* @param requests 请求列表
|
|
56
56
|
* @param options limit同时处理几个请求默认6个,onUploadProgress进度条
|
|
57
57
|
* @returns
|
|
58
58
|
*/
|
|
59
|
-
function handleRequests<T = any>(requests: PromiseInput<T>, options?: {
|
|
59
|
+
export function handleRequests<T = any>(requests: PromiseInput<T>, options?: {
|
|
60
60
|
limit?: number;
|
|
61
61
|
onUploadProgress?: (opt: {
|
|
62
62
|
total: number;
|
|
@@ -129,6 +129,18 @@ function exampleAsyncFunction() {
|
|
|
129
129
|
console.log('Array Is Stopped:', arrayIsStopped); //Array Is Stopped: false
|
|
130
130
|
})();
|
|
131
131
|
*/
|
|
132
|
-
const nsPromise: typeof nsPromiseFn;
|
|
132
|
+
export const nsPromise: typeof nsPromiseFn;
|
|
133
|
+
type RequestParam = {
|
|
134
|
+
/** 请求接口路径 */
|
|
135
|
+
url?: string;
|
|
136
|
+
/** POST请求参数 */
|
|
137
|
+
data?: any;
|
|
138
|
+
/** 前端传参方式(默认form)json => body; form=> query */
|
|
139
|
+
requestType?: any;
|
|
140
|
+
/** 前端接受类型(默认json) */
|
|
141
|
+
responseType?: any;
|
|
142
|
+
};
|
|
143
|
+
export function getAuthorization(opt: RequestParam): string;
|
|
144
|
+
export {};
|
|
133
145
|
}
|
|
134
146
|
export default RequestUtil;
|
|
@@ -123,6 +123,8 @@ import mgop, { setDefaultHeader } from './mgop';
|
|
|
123
123
|
import uniRquestFn from './uniRquest';
|
|
124
124
|
import jsonpFn, { jsonpRquest as jsonpRquestFn } from './jsonp';
|
|
125
125
|
import nsPromiseFn from './nsPromiseFn';
|
|
126
|
+
import StringUtil from '../string/StringUtil';
|
|
127
|
+
import PasswordUtil from '../pwd/PasswordUtil';
|
|
126
128
|
var RequestUtil;
|
|
127
129
|
(function (RequestUtil) {
|
|
128
130
|
/** @name 浙里办请求工具设置默认请求头 */
|
|
@@ -300,5 +302,35 @@ var RequestUtil;
|
|
|
300
302
|
})();
|
|
301
303
|
*/
|
|
302
304
|
RequestUtil.nsPromise = nsPromiseFn;
|
|
305
|
+
function getAuthorization(opt) {
|
|
306
|
+
try {
|
|
307
|
+
var uuid = StringUtil.getUuiD(16);
|
|
308
|
+
var _a = opt.data,
|
|
309
|
+
data_1 = _a === void 0 ? {} : _a,
|
|
310
|
+
url = opt.url,
|
|
311
|
+
_b = opt.requestType,
|
|
312
|
+
requestType = _b === void 0 ? 'form' : _b,
|
|
313
|
+
_c = opt.responseType,
|
|
314
|
+
responseType = _c === void 0 ? 'json' : _c;
|
|
315
|
+
var ts = new Date().getTime();
|
|
316
|
+
var paramStr = JSON.stringify(data_1);
|
|
317
|
+
if (responseType === 'json') {
|
|
318
|
+
if (requestType === 'form') {
|
|
319
|
+
var _data_1 = {};
|
|
320
|
+
var sortedKeys = Object.keys(data_1).sort(); // 对键进行排序
|
|
321
|
+
sortedKeys.forEach(function (k) {
|
|
322
|
+
if (!['null', 'undefined'].includes(String(data_1[k]))) _data_1[k] = String(data_1[k]);
|
|
323
|
+
});
|
|
324
|
+
paramStr = JSON.stringify(_data_1);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
var str = url + paramStr + ts + uuid;
|
|
328
|
+
return ts + PasswordUtil.str2MD5(str, uuid) + uuid;
|
|
329
|
+
} catch (error) {
|
|
330
|
+
console.error(error);
|
|
331
|
+
return '';
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
RequestUtil.getAuthorization = getAuthorization;
|
|
303
335
|
})(RequestUtil || (RequestUtil = {}));
|
|
304
336
|
export default RequestUtil;
|
package/lib/array/TreeUtil.js
CHANGED
|
@@ -400,7 +400,7 @@ var TreeUtil;
|
|
|
400
400
|
var _a, _b, _c;
|
|
401
401
|
item[parent] = "".concat((_a = parentData === null || parentData === void 0 ? void 0 : parentData[parent]) !== null && _a !== void 0 ? _a : '', "/").concat((_b = parentData === null || parentData === void 0 ? void 0 : parentData[label]) !== null && _b !== void 0 ? _b : '');
|
|
402
402
|
if (parentData && !((_c = item === null || item === void 0 ? void 0 : item[children]) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
403
|
-
strArr.push("".concat(item[parent], "/").concat(item[label]).split(
|
|
403
|
+
strArr.push("".concat(item[parent], "/").concat(item[label]).split('/').filter(function (e) {
|
|
404
404
|
return e;
|
|
405
405
|
}).join(splitStr));
|
|
406
406
|
}
|
package/lib/check/CheckUtil.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ console.log(isValidFileName("invalid:name.txt")); // false
|
|
|
110
110
|
* @param type 类型
|
|
111
111
|
* @param options
|
|
112
112
|
*/
|
|
113
|
-
function getFormItemRules(type: StrType, options?: {
|
|
113
|
+
function getFormItemRules(type: StrType | 'MOBILE_AES' | 'ID_CARD_AES', options?: {
|
|
114
114
|
label?: string;
|
|
115
115
|
required?: boolean;
|
|
116
116
|
errMsg?: string;
|
package/lib/check/CheckUtil.js
CHANGED
|
@@ -160,6 +160,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
160
160
|
* @author nanshen
|
|
161
161
|
* @creat 2021-09-15 10:30:46
|
|
162
162
|
*/
|
|
163
|
+
var PasswordUtil_1 = __importDefault(require("../pwd/PasswordUtil"));
|
|
163
164
|
var BaseUtil_1 = __importDefault(require("../base/BaseUtil"));
|
|
164
165
|
var common_1 = require("../common");
|
|
165
166
|
var CheckUtil;
|
|
@@ -529,7 +530,16 @@ var CheckUtil;
|
|
|
529
530
|
validator: function validator(_, value, c) {
|
|
530
531
|
return __awaiter(_this, void 0, void 0, function () {
|
|
531
532
|
return __generator(this, function (_a) {
|
|
532
|
-
if (!value
|
|
533
|
+
if (!value) return [2 /*return*/, Promise.resolve()];
|
|
534
|
+
if (type === 'MOBILE_AES') {
|
|
535
|
+
if (CheckUtil.checkAny(PasswordUtil_1.default.strDecrypt(value), 'MOBILE')) return [2 /*return*/, Promise.resolve()];
|
|
536
|
+
return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u8F93\u5165\u6B63\u786E\u7684".concat(msg, "\uFF01")))];
|
|
537
|
+
}
|
|
538
|
+
if (type === 'ID_CARD_AES') {
|
|
539
|
+
if (CheckUtil.checkAny(PasswordUtil_1.default.strDecrypt(value), 'ID_CARD')) return [2 /*return*/, Promise.resolve()];
|
|
540
|
+
return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u8F93\u5165\u6B63\u786E\u7684".concat(msg, "\uFF01")))];
|
|
541
|
+
}
|
|
542
|
+
if (CheckUtil.checkAny(value, type)) return [2 /*return*/, Promise.resolve()];
|
|
533
543
|
if (type === 'LOGIN_NAME') {
|
|
534
544
|
return [2 /*return*/, Promise.reject(new Error((options === null || options === void 0 ? void 0 : options.errMsg) || "".concat(msg, "\u53EA\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u6216\u51CF\u53F7\uFF1B\u9996\u5B57\u6BCD\u5FC5\u987B\u4E3A\u5B57\u6BCD\uFF1B\u957F\u5EA6\u4E3A6-18\u4E2A\u5B57\u7B26\uFF1B\u4E0D\u80FD\u5305\u542B\u7279\u6B8A\u5B57\u7B26")))];
|
|
535
545
|
}
|
|
@@ -34,7 +34,7 @@ declare namespace FunctionUtil {
|
|
|
34
34
|
* query()
|
|
35
35
|
* query() => 3
|
|
36
36
|
*/
|
|
37
|
-
function debounceFn<T extends
|
|
37
|
+
function debounceFn<T extends Function>(fn: T, t?: number, immediate?: boolean): T;
|
|
38
38
|
/**
|
|
39
39
|
* 函数节流
|
|
40
40
|
* @param fn 需要节流的函数
|
|
@@ -45,7 +45,7 @@ declare namespace FunctionUtil {
|
|
|
45
45
|
* query()
|
|
46
46
|
* query()
|
|
47
47
|
*/
|
|
48
|
-
function throttleFn<T extends
|
|
48
|
+
function throttleFn<T extends Function>(fn: T, t?: number): T;
|
|
49
49
|
/**
|
|
50
50
|
* 函数只能调用一次
|
|
51
51
|
* @param { Function } fn 需要被处理的函数
|
|
@@ -11,9 +11,9 @@ import nsPromiseFn from './nsPromiseFn';
|
|
|
11
11
|
export type PromiseInput<T> = Array<(() => Promise<T>) | Promise<T>> | (() => Promise<T>) | Promise<T>;
|
|
12
12
|
declare namespace RequestUtil {
|
|
13
13
|
/** @name 浙里办请求工具设置默认请求头 */
|
|
14
|
-
const mgopSetDefaultHeader: typeof setDefaultHeader;
|
|
14
|
+
export const mgopSetDefaultHeader: typeof setDefaultHeader;
|
|
15
15
|
/** @name 浙里办请求工具 */
|
|
16
|
-
const mgopRequest: typeof mgop;
|
|
16
|
+
export const mgopRequest: typeof mgop;
|
|
17
17
|
/**
|
|
18
18
|
* @name 简单发起请求
|
|
19
19
|
* @example
|
|
@@ -30,7 +30,7 @@ declare namespace RequestUtil {
|
|
|
30
30
|
dataType: 'json'
|
|
31
31
|
}).then(response => {}).catch(error => {});
|
|
32
32
|
*/
|
|
33
|
-
const uniRquest: typeof uniRquestFn;
|
|
33
|
+
export const uniRquest: typeof uniRquestFn;
|
|
34
34
|
/**
|
|
35
35
|
* @name jsonp请求工具
|
|
36
36
|
@example
|
|
@@ -41,7 +41,7 @@ declare namespace RequestUtil {
|
|
|
41
41
|
//...
|
|
42
42
|
});
|
|
43
43
|
*/
|
|
44
|
-
const jsonp: typeof jsonpFn;
|
|
44
|
+
export const jsonp: typeof jsonpFn;
|
|
45
45
|
/**
|
|
46
46
|
* @name jsonpRquest请求工具
|
|
47
47
|
@example
|
|
@@ -49,14 +49,14 @@ declare namespace RequestUtil {
|
|
|
49
49
|
url: 'https:/xxxx.com?key=1&output=jsonp'
|
|
50
50
|
}).then(response => {}).catch(error => {});
|
|
51
51
|
*/
|
|
52
|
-
const jsonpRquest: typeof jsonpRquestFn;
|
|
52
|
+
export const jsonpRquest: typeof jsonpRquestFn;
|
|
53
53
|
/**
|
|
54
54
|
* 异步请求并发处理
|
|
55
55
|
* @param requests 请求列表
|
|
56
56
|
* @param options limit同时处理几个请求默认6个,onUploadProgress进度条
|
|
57
57
|
* @returns
|
|
58
58
|
*/
|
|
59
|
-
function handleRequests<T = any>(requests: PromiseInput<T>, options?: {
|
|
59
|
+
export function handleRequests<T = any>(requests: PromiseInput<T>, options?: {
|
|
60
60
|
limit?: number;
|
|
61
61
|
onUploadProgress?: (opt: {
|
|
62
62
|
total: number;
|
|
@@ -129,6 +129,18 @@ function exampleAsyncFunction() {
|
|
|
129
129
|
console.log('Array Is Stopped:', arrayIsStopped); //Array Is Stopped: false
|
|
130
130
|
})();
|
|
131
131
|
*/
|
|
132
|
-
const nsPromise: typeof nsPromiseFn;
|
|
132
|
+
export const nsPromise: typeof nsPromiseFn;
|
|
133
|
+
type RequestParam = {
|
|
134
|
+
/** 请求接口路径 */
|
|
135
|
+
url?: string;
|
|
136
|
+
/** POST请求参数 */
|
|
137
|
+
data?: any;
|
|
138
|
+
/** 前端传参方式(默认form)json => body; form=> query */
|
|
139
|
+
requestType?: any;
|
|
140
|
+
/** 前端接受类型(默认json) */
|
|
141
|
+
responseType?: any;
|
|
142
|
+
};
|
|
143
|
+
export function getAuthorization(opt: RequestParam): string;
|
|
144
|
+
export {};
|
|
133
145
|
}
|
|
134
146
|
export default RequestUtil;
|
|
@@ -164,6 +164,8 @@ var mgop_1 = __importStar(require("./mgop"));
|
|
|
164
164
|
var uniRquest_1 = __importDefault(require("./uniRquest"));
|
|
165
165
|
var jsonp_1 = __importStar(require("./jsonp"));
|
|
166
166
|
var nsPromiseFn_1 = __importDefault(require("./nsPromiseFn"));
|
|
167
|
+
var StringUtil_1 = __importDefault(require("../string/StringUtil"));
|
|
168
|
+
var PasswordUtil_1 = __importDefault(require("../pwd/PasswordUtil"));
|
|
167
169
|
var RequestUtil;
|
|
168
170
|
(function (RequestUtil) {
|
|
169
171
|
/** @name 浙里办请求工具设置默认请求头 */
|
|
@@ -341,5 +343,35 @@ var RequestUtil;
|
|
|
341
343
|
})();
|
|
342
344
|
*/
|
|
343
345
|
RequestUtil.nsPromise = nsPromiseFn_1.default;
|
|
346
|
+
function getAuthorization(opt) {
|
|
347
|
+
try {
|
|
348
|
+
var uuid = StringUtil_1.default.getUuiD(16);
|
|
349
|
+
var _a = opt.data,
|
|
350
|
+
data_1 = _a === void 0 ? {} : _a,
|
|
351
|
+
url = opt.url,
|
|
352
|
+
_b = opt.requestType,
|
|
353
|
+
requestType = _b === void 0 ? 'form' : _b,
|
|
354
|
+
_c = opt.responseType,
|
|
355
|
+
responseType = _c === void 0 ? 'json' : _c;
|
|
356
|
+
var ts = new Date().getTime();
|
|
357
|
+
var paramStr = JSON.stringify(data_1);
|
|
358
|
+
if (responseType === 'json') {
|
|
359
|
+
if (requestType === 'form') {
|
|
360
|
+
var _data_1 = {};
|
|
361
|
+
var sortedKeys = Object.keys(data_1).sort(); // 对键进行排序
|
|
362
|
+
sortedKeys.forEach(function (k) {
|
|
363
|
+
if (!['null', 'undefined'].includes(String(data_1[k]))) _data_1[k] = String(data_1[k]);
|
|
364
|
+
});
|
|
365
|
+
paramStr = JSON.stringify(_data_1);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
var str = url + paramStr + ts + uuid;
|
|
369
|
+
return ts + PasswordUtil_1.default.str2MD5(str, uuid) + uuid;
|
|
370
|
+
} catch (error) {
|
|
371
|
+
console.error(error);
|
|
372
|
+
return '';
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
RequestUtil.getAuthorization = getAuthorization;
|
|
344
376
|
})(RequestUtil || (RequestUtil = {}));
|
|
345
377
|
exports.default = RequestUtil;
|