@indfnd/utils 0.1.36 → 0.1.38
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/CHANGELOG.md +30 -0
- package/dist/ind-utils.es.js +865 -607
- package/dist/ind-utils.umd.cjs +21 -21
- package/global.d.ts +2 -0
- package/package.json +1 -1
- package/src/api/com.ts +4 -2
- package/src/api/item.ts +4 -2
- package/src/api/platform/oss.ts +6 -3
- package/src/utils/excel.js +157 -0
- package/types/api/com.d.ts +2 -4
- package/types/api/com.d.ts.map +1 -1
- package/types/api/index-desc.d.ts +2 -4
- package/types/api/index-desc.d.ts.map +1 -1
- package/types/api/index.d.ts +7 -7
- package/types/api/item.d.ts +4 -6
- package/types/api/item.d.ts.map +1 -1
- package/types/api/permission.d.ts +2 -2
- package/types/api/platform/base64.d.ts +5 -5
- package/types/api/platform/config.d.ts +2 -2
- package/types/api/platform/dict.d.ts +4 -6
- package/types/api/platform/dict.d.ts.map +1 -1
- package/types/api/platform/index.d.ts +6 -6
- package/types/api/platform/menu.d.ts +11 -21
- package/types/api/platform/menu.d.ts.map +1 -1
- package/types/api/platform/oss.d.ts +8 -16
- package/types/api/platform/oss.d.ts.map +1 -1
- package/types/api/platform/user.d.ts +12 -19
- package/types/api/platform/user.d.ts.map +1 -1
- package/types/api/user.d.ts +2 -2
- package/types/config/base.config.d.ts +33 -33
- package/types/config/dev.config.d.ts +3 -3
- package/types/config/index.d.ts +6 -6
- package/types/config/prod.config.d.ts +3 -3
- package/types/index.d.ts +4 -4
- package/types/utils/base64.d.ts +22 -22
- package/types/utils/blob.d.ts +3 -3
- package/types/utils/cache/dict-cache.d.ts +3 -3
- package/types/utils/cache/index-desc.d.ts +4 -4
- package/types/utils/cache/index.d.ts +4 -4
- package/types/utils/cache/permission-cache.d.ts +4 -4
- package/types/utils/cache/user-cache.d.ts +4 -4
- package/types/utils/date.d.ts +4 -4
- package/types/utils/enum.d.ts +39 -43
- package/types/utils/event.d.ts +5 -13
- package/types/utils/excel.d.ts +5 -4
- package/types/utils/excel.d.ts.map +1 -1
- package/types/utils/half-year.d.ts +6 -6
- package/types/utils/index.d.ts +20 -20
- package/types/utils/is-type.d.ts +33 -33
- package/types/utils/mime-type.d.ts +67 -67
- package/types/utils/number.d.ts +8 -8
- package/types/utils/quarter.d.ts +7 -7
- package/types/utils/request/axios.extends.d.ts +6 -18
- package/types/utils/request/cache-rules.d.ts +3 -3
- package/types/utils/request/content-type.d.ts +9 -9
- package/types/utils/request/index.d.ts +13 -16
- package/types/utils/request/interceptors.d.ts +4 -4
- package/types/utils/request/url-params.d.ts +6 -6
- package/types/utils/sm3/index.d.ts +6 -6
- package/types/utils/sm3/sm3.d.ts +3 -3
- package/types/utils/storage.d.ts +8 -8
- package/types/utils/table.d.ts +31 -40
- package/types/utils/token.d.ts +3 -3
- package/types/utils/uuid.d.ts +4 -4
- package/types/utils/validate.d.ts +5 -5
package/dist/ind-utils.es.js
CHANGED
|
@@ -96,8 +96,8 @@ const INDEX_DESC_KEY = "indexDesc";
|
|
|
96
96
|
function getIndexDescCache() {
|
|
97
97
|
return getLocalStorage(INDEX_DESC_KEY);
|
|
98
98
|
}
|
|
99
|
-
function setIndexDescCache(
|
|
100
|
-
setLocalStorage(INDEX_DESC_KEY,
|
|
99
|
+
function setIndexDescCache(data) {
|
|
100
|
+
setLocalStorage(INDEX_DESC_KEY, data);
|
|
101
101
|
}
|
|
102
102
|
function clearIndexDescCache() {
|
|
103
103
|
removeLocalStorage(INDEX_DESC_KEY);
|
|
@@ -106,8 +106,8 @@ const PERMISSION_KEY = "ibp-sc-permission";
|
|
|
106
106
|
function getPermissionCache() {
|
|
107
107
|
return getSessionStorage(PERMISSION_KEY);
|
|
108
108
|
}
|
|
109
|
-
function setPermissionCache(
|
|
110
|
-
setSessionStorage(PERMISSION_KEY,
|
|
109
|
+
function setPermissionCache(data) {
|
|
110
|
+
setSessionStorage(PERMISSION_KEY, data);
|
|
111
111
|
}
|
|
112
112
|
function clearPermissionCache() {
|
|
113
113
|
removeSessionStorage(PERMISSION_KEY);
|
|
@@ -116,8 +116,8 @@ const USER_INFO_KEY = "lambo-userInfo";
|
|
|
116
116
|
function getUserInfoCache() {
|
|
117
117
|
return getSessionStorage(USER_INFO_KEY);
|
|
118
118
|
}
|
|
119
|
-
function setUserInfoCache(
|
|
120
|
-
setSessionStorage(USER_INFO_KEY,
|
|
119
|
+
function setUserInfoCache(data) {
|
|
120
|
+
setSessionStorage(USER_INFO_KEY, data);
|
|
121
121
|
}
|
|
122
122
|
function clearUserInfoCache() {
|
|
123
123
|
removeSessionStorage(USER_INFO_KEY);
|
|
@@ -366,10 +366,10 @@ InterceptorManager$1.prototype.forEach = function forEach2(fn) {
|
|
|
366
366
|
var InterceptorManager_1 = InterceptorManager$1;
|
|
367
367
|
var utils$d = utils$g;
|
|
368
368
|
var normalizeHeaderName$1 = function normalizeHeaderName(headers, normalizedName) {
|
|
369
|
-
utils$d.forEach(headers, function processHeader(value,
|
|
370
|
-
if (
|
|
369
|
+
utils$d.forEach(headers, function processHeader(value, name2) {
|
|
370
|
+
if (name2 !== normalizedName && name2.toUpperCase() === normalizedName.toUpperCase()) {
|
|
371
371
|
headers[normalizedName] = value;
|
|
372
|
-
delete headers[
|
|
372
|
+
delete headers[name2];
|
|
373
373
|
}
|
|
374
374
|
});
|
|
375
375
|
};
|
|
@@ -392,8 +392,7 @@ var enhanceError$2 = function enhanceError(error, config2, code, request2, respo
|
|
|
392
392
|
columnNumber: this.columnNumber,
|
|
393
393
|
stack: this.stack,
|
|
394
394
|
config: this.config,
|
|
395
|
-
code: this.code
|
|
396
|
-
status: this.response && this.response.status ? this.response.status : null
|
|
395
|
+
code: this.code
|
|
397
396
|
};
|
|
398
397
|
};
|
|
399
398
|
return error;
|
|
@@ -421,9 +420,9 @@ var settle$1 = function settle(resolve, reject, response) {
|
|
|
421
420
|
var utils$c = utils$g;
|
|
422
421
|
var cookies$1 = utils$c.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
423
422
|
return {
|
|
424
|
-
write: function write(
|
|
423
|
+
write: function write(name2, value, expires, path, domain, secure) {
|
|
425
424
|
var cookie = [];
|
|
426
|
-
cookie.push(
|
|
425
|
+
cookie.push(name2 + "=" + encodeURIComponent(value));
|
|
427
426
|
if (utils$c.isNumber(expires)) {
|
|
428
427
|
cookie.push("expires=" + new Date(expires).toGMTString());
|
|
429
428
|
}
|
|
@@ -438,12 +437,12 @@ var cookies$1 = utils$c.isStandardBrowserEnv() ? function standardBrowserEnv() {
|
|
|
438
437
|
}
|
|
439
438
|
document.cookie = cookie.join("; ");
|
|
440
439
|
},
|
|
441
|
-
read: function read(
|
|
442
|
-
var match = document.cookie.match(new RegExp("(^|;\\s*)(" +
|
|
440
|
+
read: function read(name2) {
|
|
441
|
+
var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
|
|
443
442
|
return match ? decodeURIComponent(match[3]) : null;
|
|
444
443
|
},
|
|
445
|
-
remove: function remove(
|
|
446
|
-
this.write(
|
|
444
|
+
remove: function remove(name2) {
|
|
445
|
+
this.write(name2, "", Date.now() - 864e5);
|
|
447
446
|
}
|
|
448
447
|
};
|
|
449
448
|
}() : function nonStandardBrowserEnv() {
|
|
@@ -549,14 +548,6 @@ var isURLSameOrigin$1 = utils$a.isStandardBrowserEnv() ? function standardBrowse
|
|
|
549
548
|
return true;
|
|
550
549
|
};
|
|
551
550
|
}();
|
|
552
|
-
function Cancel$3(message) {
|
|
553
|
-
this.message = message;
|
|
554
|
-
}
|
|
555
|
-
Cancel$3.prototype.toString = function toString() {
|
|
556
|
-
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
557
|
-
};
|
|
558
|
-
Cancel$3.prototype.__CANCEL__ = true;
|
|
559
|
-
var Cancel_1 = Cancel$3;
|
|
560
551
|
var utils$9 = utils$g;
|
|
561
552
|
var settle2 = settle$1;
|
|
562
553
|
var cookies = cookies$1;
|
|
@@ -565,22 +556,11 @@ var buildFullPath2 = buildFullPath$1;
|
|
|
565
556
|
var parseHeaders2 = parseHeaders$1;
|
|
566
557
|
var isURLSameOrigin = isURLSameOrigin$1;
|
|
567
558
|
var createError2 = createError$2;
|
|
568
|
-
var defaults$6 = defaults_1;
|
|
569
|
-
var Cancel$2 = Cancel_1;
|
|
570
559
|
var xhr = function xhrAdapter(config2) {
|
|
571
560
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
572
561
|
var requestData = config2.data;
|
|
573
562
|
var requestHeaders = config2.headers;
|
|
574
563
|
var responseType = config2.responseType;
|
|
575
|
-
var onCanceled;
|
|
576
|
-
function done() {
|
|
577
|
-
if (config2.cancelToken) {
|
|
578
|
-
config2.cancelToken.unsubscribe(onCanceled);
|
|
579
|
-
}
|
|
580
|
-
if (config2.signal) {
|
|
581
|
-
config2.signal.removeEventListener("abort", onCanceled);
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
564
|
if (utils$9.isFormData(requestData)) {
|
|
585
565
|
delete requestHeaders["Content-Type"];
|
|
586
566
|
}
|
|
@@ -607,13 +587,7 @@ var xhr = function xhrAdapter(config2) {
|
|
|
607
587
|
config: config2,
|
|
608
588
|
request: request2
|
|
609
589
|
};
|
|
610
|
-
settle2(
|
|
611
|
-
resolve(value);
|
|
612
|
-
done();
|
|
613
|
-
}, function _reject(err) {
|
|
614
|
-
reject(err);
|
|
615
|
-
done();
|
|
616
|
-
}, response);
|
|
590
|
+
settle2(resolve, reject, response);
|
|
617
591
|
request2 = null;
|
|
618
592
|
}
|
|
619
593
|
if ("onloadend" in request2) {
|
|
@@ -641,15 +615,14 @@ var xhr = function xhrAdapter(config2) {
|
|
|
641
615
|
request2 = null;
|
|
642
616
|
};
|
|
643
617
|
request2.ontimeout = function handleTimeout() {
|
|
644
|
-
var timeoutErrorMessage =
|
|
645
|
-
var transitional2 = config2.transitional || defaults$6.transitional;
|
|
618
|
+
var timeoutErrorMessage = "timeout of " + config2.timeout + "ms exceeded";
|
|
646
619
|
if (config2.timeoutErrorMessage) {
|
|
647
620
|
timeoutErrorMessage = config2.timeoutErrorMessage;
|
|
648
621
|
}
|
|
649
622
|
reject(createError2(
|
|
650
623
|
timeoutErrorMessage,
|
|
651
624
|
config2,
|
|
652
|
-
|
|
625
|
+
config2.transitional && config2.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
653
626
|
request2
|
|
654
627
|
));
|
|
655
628
|
request2 = null;
|
|
@@ -681,19 +654,15 @@ var xhr = function xhrAdapter(config2) {
|
|
|
681
654
|
if (typeof config2.onUploadProgress === "function" && request2.upload) {
|
|
682
655
|
request2.upload.addEventListener("progress", config2.onUploadProgress);
|
|
683
656
|
}
|
|
684
|
-
if (config2.cancelToken
|
|
685
|
-
onCanceled
|
|
657
|
+
if (config2.cancelToken) {
|
|
658
|
+
config2.cancelToken.promise.then(function onCanceled(cancel) {
|
|
686
659
|
if (!request2) {
|
|
687
660
|
return;
|
|
688
661
|
}
|
|
689
|
-
reject(!cancel || cancel && cancel.type ? new Cancel$2("canceled") : cancel);
|
|
690
662
|
request2.abort();
|
|
663
|
+
reject(cancel);
|
|
691
664
|
request2 = null;
|
|
692
|
-
};
|
|
693
|
-
config2.cancelToken && config2.cancelToken.subscribe(onCanceled);
|
|
694
|
-
if (config2.signal) {
|
|
695
|
-
config2.signal.aborted ? onCanceled() : config2.signal.addEventListener("abort", onCanceled);
|
|
696
|
-
}
|
|
665
|
+
});
|
|
697
666
|
}
|
|
698
667
|
if (!requestData) {
|
|
699
668
|
requestData = null;
|
|
@@ -741,33 +710,33 @@ var defaults$5 = {
|
|
|
741
710
|
clarifyTimeoutError: false
|
|
742
711
|
},
|
|
743
712
|
adapter: getDefaultAdapter(),
|
|
744
|
-
transformRequest: [function transformRequest(
|
|
713
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
745
714
|
normalizeHeaderName2(headers, "Accept");
|
|
746
715
|
normalizeHeaderName2(headers, "Content-Type");
|
|
747
|
-
if (utils$8.isFormData(
|
|
748
|
-
return
|
|
716
|
+
if (utils$8.isFormData(data) || utils$8.isArrayBuffer(data) || utils$8.isBuffer(data) || utils$8.isStream(data) || utils$8.isFile(data) || utils$8.isBlob(data)) {
|
|
717
|
+
return data;
|
|
749
718
|
}
|
|
750
|
-
if (utils$8.isArrayBufferView(
|
|
751
|
-
return
|
|
719
|
+
if (utils$8.isArrayBufferView(data)) {
|
|
720
|
+
return data.buffer;
|
|
752
721
|
}
|
|
753
|
-
if (utils$8.isURLSearchParams(
|
|
722
|
+
if (utils$8.isURLSearchParams(data)) {
|
|
754
723
|
setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
|
|
755
|
-
return
|
|
724
|
+
return data.toString();
|
|
756
725
|
}
|
|
757
|
-
if (utils$8.isObject(
|
|
726
|
+
if (utils$8.isObject(data) || headers && headers["Content-Type"] === "application/json") {
|
|
758
727
|
setContentTypeIfUnset(headers, "application/json");
|
|
759
|
-
return stringifySafely(
|
|
728
|
+
return stringifySafely(data);
|
|
760
729
|
}
|
|
761
|
-
return
|
|
730
|
+
return data;
|
|
762
731
|
}],
|
|
763
|
-
transformResponse: [function transformResponse(
|
|
764
|
-
var transitional2 = this.transitional
|
|
732
|
+
transformResponse: [function transformResponse(data) {
|
|
733
|
+
var transitional2 = this.transitional;
|
|
765
734
|
var silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
766
735
|
var forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
|
|
767
736
|
var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
|
|
768
|
-
if (strictJSONParsing || forcedJSONParsing && utils$8.isString(
|
|
737
|
+
if (strictJSONParsing || forcedJSONParsing && utils$8.isString(data) && data.length) {
|
|
769
738
|
try {
|
|
770
|
-
return JSON.parse(
|
|
739
|
+
return JSON.parse(data);
|
|
771
740
|
} catch (e) {
|
|
772
741
|
if (strictJSONParsing) {
|
|
773
742
|
if (e.name === "SyntaxError") {
|
|
@@ -777,7 +746,7 @@ var defaults$5 = {
|
|
|
777
746
|
}
|
|
778
747
|
}
|
|
779
748
|
}
|
|
780
|
-
return
|
|
749
|
+
return data;
|
|
781
750
|
}],
|
|
782
751
|
timeout: 0,
|
|
783
752
|
xsrfCookieName: "XSRF-TOKEN",
|
|
@@ -786,11 +755,11 @@ var defaults$5 = {
|
|
|
786
755
|
maxBodyLength: -1,
|
|
787
756
|
validateStatus: function validateStatus(status) {
|
|
788
757
|
return status >= 200 && status < 300;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
defaults$5.headers = {
|
|
761
|
+
common: {
|
|
762
|
+
"Accept": "application/json, text/plain, */*"
|
|
794
763
|
}
|
|
795
764
|
};
|
|
796
765
|
utils$8.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
|
|
@@ -802,12 +771,12 @@ utils$8.forEach(["post", "put", "patch"], function forEachMethodWithData(method)
|
|
|
802
771
|
var defaults_1 = defaults$5;
|
|
803
772
|
var utils$7 = utils$g;
|
|
804
773
|
var defaults$4 = defaults_1;
|
|
805
|
-
var transformData$1 = function transformData(
|
|
774
|
+
var transformData$1 = function transformData(data, headers, fns) {
|
|
806
775
|
var context = this || defaults$4;
|
|
807
776
|
utils$7.forEach(fns, function transform(fn) {
|
|
808
|
-
|
|
777
|
+
data = fn.call(context, data, headers);
|
|
809
778
|
});
|
|
810
|
-
return
|
|
779
|
+
return data;
|
|
811
780
|
};
|
|
812
781
|
var isCancel$1 = function isCancel(value) {
|
|
813
782
|
return !!(value && value.__CANCEL__);
|
|
@@ -816,14 +785,10 @@ var utils$6 = utils$g;
|
|
|
816
785
|
var transformData2 = transformData$1;
|
|
817
786
|
var isCancel2 = isCancel$1;
|
|
818
787
|
var defaults$3 = defaults_1;
|
|
819
|
-
var Cancel$1 = Cancel_1;
|
|
820
788
|
function throwIfCancellationRequested(config2) {
|
|
821
789
|
if (config2.cancelToken) {
|
|
822
790
|
config2.cancelToken.throwIfRequested();
|
|
823
791
|
}
|
|
824
|
-
if (config2.signal && config2.signal.aborted) {
|
|
825
|
-
throw new Cancel$1("canceled");
|
|
826
|
-
}
|
|
827
792
|
}
|
|
828
793
|
var dispatchRequest$1 = function dispatchRequest(config2) {
|
|
829
794
|
throwIfCancellationRequested(config2);
|
|
@@ -874,6 +839,34 @@ var utils$5 = utils$g;
|
|
|
874
839
|
var mergeConfig$2 = function mergeConfig(config1, config2) {
|
|
875
840
|
config2 = config2 || {};
|
|
876
841
|
var config3 = {};
|
|
842
|
+
var valueFromConfig2Keys = ["url", "method", "data"];
|
|
843
|
+
var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"];
|
|
844
|
+
var defaultToConfig2Keys = [
|
|
845
|
+
"baseURL",
|
|
846
|
+
"transformRequest",
|
|
847
|
+
"transformResponse",
|
|
848
|
+
"paramsSerializer",
|
|
849
|
+
"timeout",
|
|
850
|
+
"timeoutMessage",
|
|
851
|
+
"withCredentials",
|
|
852
|
+
"adapter",
|
|
853
|
+
"responseType",
|
|
854
|
+
"xsrfCookieName",
|
|
855
|
+
"xsrfHeaderName",
|
|
856
|
+
"onUploadProgress",
|
|
857
|
+
"onDownloadProgress",
|
|
858
|
+
"decompress",
|
|
859
|
+
"maxContentLength",
|
|
860
|
+
"maxBodyLength",
|
|
861
|
+
"maxRedirects",
|
|
862
|
+
"transport",
|
|
863
|
+
"httpAgent",
|
|
864
|
+
"httpsAgent",
|
|
865
|
+
"cancelToken",
|
|
866
|
+
"socketPath",
|
|
867
|
+
"responseEncoding"
|
|
868
|
+
];
|
|
869
|
+
var directMergeKeys = ["validateStatus"];
|
|
877
870
|
function getMergedValue(target, source2) {
|
|
878
871
|
if (utils$5.isPlainObject(target) && utils$5.isPlainObject(source2)) {
|
|
879
872
|
return utils$5.merge(target, source2);
|
|
@@ -886,69 +879,141 @@ var mergeConfig$2 = function mergeConfig(config1, config2) {
|
|
|
886
879
|
}
|
|
887
880
|
function mergeDeepProperties(prop) {
|
|
888
881
|
if (!utils$5.isUndefined(config2[prop])) {
|
|
889
|
-
|
|
882
|
+
config3[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
890
883
|
} else if (!utils$5.isUndefined(config1[prop])) {
|
|
891
|
-
|
|
884
|
+
config3[prop] = getMergedValue(void 0, config1[prop]);
|
|
892
885
|
}
|
|
893
886
|
}
|
|
894
|
-
function valueFromConfig2(prop) {
|
|
887
|
+
utils$5.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
|
|
895
888
|
if (!utils$5.isUndefined(config2[prop])) {
|
|
896
|
-
|
|
889
|
+
config3[prop] = getMergedValue(void 0, config2[prop]);
|
|
897
890
|
}
|
|
898
|
-
}
|
|
899
|
-
|
|
891
|
+
});
|
|
892
|
+
utils$5.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
|
|
893
|
+
utils$5.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
|
|
900
894
|
if (!utils$5.isUndefined(config2[prop])) {
|
|
901
|
-
|
|
895
|
+
config3[prop] = getMergedValue(void 0, config2[prop]);
|
|
902
896
|
} else if (!utils$5.isUndefined(config1[prop])) {
|
|
903
|
-
|
|
897
|
+
config3[prop] = getMergedValue(void 0, config1[prop]);
|
|
904
898
|
}
|
|
905
|
-
}
|
|
906
|
-
function
|
|
899
|
+
});
|
|
900
|
+
utils$5.forEach(directMergeKeys, function merge3(prop) {
|
|
907
901
|
if (prop in config2) {
|
|
908
|
-
|
|
902
|
+
config3[prop] = getMergedValue(config1[prop], config2[prop]);
|
|
909
903
|
} else if (prop in config1) {
|
|
910
|
-
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
var
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
"data": valueFromConfig2,
|
|
917
|
-
"baseURL": defaultToConfig2,
|
|
918
|
-
"transformRequest": defaultToConfig2,
|
|
919
|
-
"transformResponse": defaultToConfig2,
|
|
920
|
-
"paramsSerializer": defaultToConfig2,
|
|
921
|
-
"timeout": defaultToConfig2,
|
|
922
|
-
"timeoutMessage": defaultToConfig2,
|
|
923
|
-
"withCredentials": defaultToConfig2,
|
|
924
|
-
"adapter": defaultToConfig2,
|
|
925
|
-
"responseType": defaultToConfig2,
|
|
926
|
-
"xsrfCookieName": defaultToConfig2,
|
|
927
|
-
"xsrfHeaderName": defaultToConfig2,
|
|
928
|
-
"onUploadProgress": defaultToConfig2,
|
|
929
|
-
"onDownloadProgress": defaultToConfig2,
|
|
930
|
-
"decompress": defaultToConfig2,
|
|
931
|
-
"maxContentLength": defaultToConfig2,
|
|
932
|
-
"maxBodyLength": defaultToConfig2,
|
|
933
|
-
"transport": defaultToConfig2,
|
|
934
|
-
"httpAgent": defaultToConfig2,
|
|
935
|
-
"httpsAgent": defaultToConfig2,
|
|
936
|
-
"cancelToken": defaultToConfig2,
|
|
937
|
-
"socketPath": defaultToConfig2,
|
|
938
|
-
"responseEncoding": defaultToConfig2,
|
|
939
|
-
"validateStatus": mergeDirectKeys
|
|
940
|
-
};
|
|
941
|
-
utils$5.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
|
|
942
|
-
var merge3 = mergeMap[prop] || mergeDeepProperties;
|
|
943
|
-
var configValue = merge3(prop);
|
|
944
|
-
utils$5.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config3[prop] = configValue);
|
|
904
|
+
config3[prop] = getMergedValue(void 0, config1[prop]);
|
|
905
|
+
}
|
|
906
|
+
});
|
|
907
|
+
var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
|
|
908
|
+
var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key) {
|
|
909
|
+
return axiosKeys.indexOf(key) === -1;
|
|
945
910
|
});
|
|
911
|
+
utils$5.forEach(otherKeys, mergeDeepProperties);
|
|
946
912
|
return config3;
|
|
947
913
|
};
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
914
|
+
const name = "axios";
|
|
915
|
+
const version = "0.21.4";
|
|
916
|
+
const description = "Promise based HTTP client for the browser and node.js";
|
|
917
|
+
const main = "index.js";
|
|
918
|
+
const scripts = {
|
|
919
|
+
test: "grunt test",
|
|
920
|
+
start: "node ./sandbox/server.js",
|
|
921
|
+
build: "NODE_ENV=production grunt build",
|
|
922
|
+
preversion: "npm test",
|
|
923
|
+
version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",
|
|
924
|
+
postversion: "git push && git push --tags",
|
|
925
|
+
examples: "node ./examples/server.js",
|
|
926
|
+
coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
927
|
+
fix: "eslint --fix lib/**/*.js"
|
|
928
|
+
};
|
|
929
|
+
const repository = {
|
|
930
|
+
type: "git",
|
|
931
|
+
url: "https://github.com/axios/axios.git"
|
|
932
|
+
};
|
|
933
|
+
const keywords = [
|
|
934
|
+
"xhr",
|
|
935
|
+
"http",
|
|
936
|
+
"ajax",
|
|
937
|
+
"promise",
|
|
938
|
+
"node"
|
|
939
|
+
];
|
|
940
|
+
const author = "Matt Zabriskie";
|
|
941
|
+
const license = "MIT";
|
|
942
|
+
const bugs = {
|
|
943
|
+
url: "https://github.com/axios/axios/issues"
|
|
944
|
+
};
|
|
945
|
+
const homepage = "https://axios-http.com";
|
|
946
|
+
const devDependencies = {
|
|
947
|
+
coveralls: "^3.0.0",
|
|
948
|
+
"es6-promise": "^4.2.4",
|
|
949
|
+
grunt: "^1.3.0",
|
|
950
|
+
"grunt-banner": "^0.6.0",
|
|
951
|
+
"grunt-cli": "^1.2.0",
|
|
952
|
+
"grunt-contrib-clean": "^1.1.0",
|
|
953
|
+
"grunt-contrib-watch": "^1.0.0",
|
|
954
|
+
"grunt-eslint": "^23.0.0",
|
|
955
|
+
"grunt-karma": "^4.0.0",
|
|
956
|
+
"grunt-mocha-test": "^0.13.3",
|
|
957
|
+
"grunt-ts": "^6.0.0-beta.19",
|
|
958
|
+
"grunt-webpack": "^4.0.2",
|
|
959
|
+
"istanbul-instrumenter-loader": "^1.0.0",
|
|
960
|
+
"jasmine-core": "^2.4.1",
|
|
961
|
+
karma: "^6.3.2",
|
|
962
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
963
|
+
"karma-firefox-launcher": "^2.1.0",
|
|
964
|
+
"karma-jasmine": "^1.1.1",
|
|
965
|
+
"karma-jasmine-ajax": "^0.1.13",
|
|
966
|
+
"karma-safari-launcher": "^1.0.0",
|
|
967
|
+
"karma-sauce-launcher": "^4.3.6",
|
|
968
|
+
"karma-sinon": "^1.0.5",
|
|
969
|
+
"karma-sourcemap-loader": "^0.3.8",
|
|
970
|
+
"karma-webpack": "^4.0.2",
|
|
971
|
+
"load-grunt-tasks": "^3.5.2",
|
|
972
|
+
minimist: "^1.2.0",
|
|
973
|
+
mocha: "^8.2.1",
|
|
974
|
+
sinon: "^4.5.0",
|
|
975
|
+
"terser-webpack-plugin": "^4.2.3",
|
|
976
|
+
typescript: "^4.0.5",
|
|
977
|
+
"url-search-params": "^0.10.0",
|
|
978
|
+
webpack: "^4.44.2",
|
|
979
|
+
"webpack-dev-server": "^3.11.0"
|
|
980
|
+
};
|
|
981
|
+
const browser = {
|
|
982
|
+
"./lib/adapters/http.js": "./lib/adapters/xhr.js"
|
|
983
|
+
};
|
|
984
|
+
const jsdelivr = "dist/axios.min.js";
|
|
985
|
+
const unpkg = "dist/axios.min.js";
|
|
986
|
+
const typings = "./index.d.ts";
|
|
987
|
+
const dependencies = {
|
|
988
|
+
"follow-redirects": "^1.14.0"
|
|
989
|
+
};
|
|
990
|
+
const bundlesize = [
|
|
991
|
+
{
|
|
992
|
+
path: "./dist/axios.min.js",
|
|
993
|
+
threshold: "5kB"
|
|
994
|
+
}
|
|
995
|
+
];
|
|
996
|
+
var require$$0$1 = {
|
|
997
|
+
name,
|
|
998
|
+
version,
|
|
999
|
+
description,
|
|
1000
|
+
main,
|
|
1001
|
+
scripts,
|
|
1002
|
+
repository,
|
|
1003
|
+
keywords,
|
|
1004
|
+
author,
|
|
1005
|
+
license,
|
|
1006
|
+
bugs,
|
|
1007
|
+
homepage,
|
|
1008
|
+
devDependencies,
|
|
1009
|
+
browser,
|
|
1010
|
+
jsdelivr,
|
|
1011
|
+
unpkg,
|
|
1012
|
+
typings,
|
|
1013
|
+
dependencies,
|
|
1014
|
+
bundlesize
|
|
1015
|
+
};
|
|
1016
|
+
var pkg = require$$0$1;
|
|
952
1017
|
var validators$1 = {};
|
|
953
1018
|
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
|
|
954
1019
|
validators$1[type] = function validator2(thing) {
|
|
@@ -956,20 +1021,34 @@ var validators$1 = {};
|
|
|
956
1021
|
};
|
|
957
1022
|
});
|
|
958
1023
|
var deprecatedWarnings = {};
|
|
959
|
-
|
|
1024
|
+
var currentVerArr = pkg.version.split(".");
|
|
1025
|
+
function isOlderVersion(version2, thanVersion) {
|
|
1026
|
+
var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr;
|
|
1027
|
+
var destVer = version2.split(".");
|
|
1028
|
+
for (var i = 0; i < 3; i++) {
|
|
1029
|
+
if (pkgVersionArr[i] > destVer[i]) {
|
|
1030
|
+
return true;
|
|
1031
|
+
} else if (pkgVersionArr[i] < destVer[i]) {
|
|
1032
|
+
return false;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
return false;
|
|
1036
|
+
}
|
|
1037
|
+
validators$1.transitional = function transitional(validator2, version2, message) {
|
|
1038
|
+
var isDeprecated = version2 && isOlderVersion(version2);
|
|
960
1039
|
function formatMessage(opt, desc) {
|
|
961
|
-
return "[Axios v" +
|
|
1040
|
+
return "[Axios v" + pkg.version + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
|
|
962
1041
|
}
|
|
963
1042
|
return function(value, opt, opts) {
|
|
964
1043
|
if (validator2 === false) {
|
|
965
|
-
throw new Error(formatMessage(opt, " has been removed
|
|
1044
|
+
throw new Error(formatMessage(opt, " has been removed in " + version2));
|
|
966
1045
|
}
|
|
967
|
-
if (
|
|
1046
|
+
if (isDeprecated && !deprecatedWarnings[opt]) {
|
|
968
1047
|
deprecatedWarnings[opt] = true;
|
|
969
1048
|
console.warn(
|
|
970
1049
|
formatMessage(
|
|
971
1050
|
opt,
|
|
972
|
-
" has been deprecated since v" +
|
|
1051
|
+
" has been deprecated since v" + version2 + " and will be removed in the near future"
|
|
973
1052
|
)
|
|
974
1053
|
);
|
|
975
1054
|
}
|
|
@@ -999,6 +1078,7 @@ function assertOptions(options, schema, allowUnknown) {
|
|
|
999
1078
|
}
|
|
1000
1079
|
}
|
|
1001
1080
|
var validator$1 = {
|
|
1081
|
+
isOlderVersion,
|
|
1002
1082
|
assertOptions,
|
|
1003
1083
|
validators: validators$1
|
|
1004
1084
|
};
|
|
@@ -1034,9 +1114,9 @@ Axios$1.prototype.request = function request(config2) {
|
|
|
1034
1114
|
var transitional2 = config2.transitional;
|
|
1035
1115
|
if (transitional2 !== void 0) {
|
|
1036
1116
|
validator.assertOptions(transitional2, {
|
|
1037
|
-
silentJSONParsing: validators.transitional(validators.boolean),
|
|
1038
|
-
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
1039
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
1117
|
+
silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
|
|
1118
|
+
forcedJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
|
|
1119
|
+
clarifyTimeoutError: validators.transitional(validators.boolean, "1.0.0")
|
|
1040
1120
|
}, false);
|
|
1041
1121
|
}
|
|
1042
1122
|
var requestInterceptorChain = [];
|
|
@@ -1098,15 +1178,23 @@ utils$4.forEach(["delete", "get", "head", "options"], function forEachMethodNoDa
|
|
|
1098
1178
|
};
|
|
1099
1179
|
});
|
|
1100
1180
|
utils$4.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
1101
|
-
Axios$1.prototype[method] = function(url,
|
|
1181
|
+
Axios$1.prototype[method] = function(url, data, config2) {
|
|
1102
1182
|
return this.request(mergeConfig$1(config2 || {}, {
|
|
1103
1183
|
method,
|
|
1104
1184
|
url,
|
|
1105
|
-
data
|
|
1185
|
+
data
|
|
1106
1186
|
}));
|
|
1107
1187
|
};
|
|
1108
1188
|
});
|
|
1109
1189
|
var Axios_1 = Axios$1;
|
|
1190
|
+
function Cancel$1(message) {
|
|
1191
|
+
this.message = message;
|
|
1192
|
+
}
|
|
1193
|
+
Cancel$1.prototype.toString = function toString() {
|
|
1194
|
+
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
1195
|
+
};
|
|
1196
|
+
Cancel$1.prototype.__CANCEL__ = true;
|
|
1197
|
+
var Cancel_1 = Cancel$1;
|
|
1110
1198
|
var Cancel = Cancel_1;
|
|
1111
1199
|
function CancelToken(executor) {
|
|
1112
1200
|
if (typeof executor !== "function") {
|
|
@@ -1117,27 +1205,6 @@ function CancelToken(executor) {
|
|
|
1117
1205
|
resolvePromise = resolve;
|
|
1118
1206
|
});
|
|
1119
1207
|
var token = this;
|
|
1120
|
-
this.promise.then(function(cancel) {
|
|
1121
|
-
if (!token._listeners)
|
|
1122
|
-
return;
|
|
1123
|
-
var i;
|
|
1124
|
-
var l = token._listeners.length;
|
|
1125
|
-
for (i = 0; i < l; i++) {
|
|
1126
|
-
token._listeners[i](cancel);
|
|
1127
|
-
}
|
|
1128
|
-
token._listeners = null;
|
|
1129
|
-
});
|
|
1130
|
-
this.promise.then = function(onfulfilled) {
|
|
1131
|
-
var _resolve;
|
|
1132
|
-
var promise = new Promise(function(resolve) {
|
|
1133
|
-
token.subscribe(resolve);
|
|
1134
|
-
_resolve = resolve;
|
|
1135
|
-
}).then(onfulfilled);
|
|
1136
|
-
promise.cancel = function reject() {
|
|
1137
|
-
token.unsubscribe(_resolve);
|
|
1138
|
-
};
|
|
1139
|
-
return promise;
|
|
1140
|
-
};
|
|
1141
1208
|
executor(function cancel(message) {
|
|
1142
1209
|
if (token.reason) {
|
|
1143
1210
|
return;
|
|
@@ -1151,26 +1218,6 @@ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
|
|
|
1151
1218
|
throw this.reason;
|
|
1152
1219
|
}
|
|
1153
1220
|
};
|
|
1154
|
-
CancelToken.prototype.subscribe = function subscribe(listener) {
|
|
1155
|
-
if (this.reason) {
|
|
1156
|
-
listener(this.reason);
|
|
1157
|
-
return;
|
|
1158
|
-
}
|
|
1159
|
-
if (this._listeners) {
|
|
1160
|
-
this._listeners.push(listener);
|
|
1161
|
-
} else {
|
|
1162
|
-
this._listeners = [listener];
|
|
1163
|
-
}
|
|
1164
|
-
};
|
|
1165
|
-
CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
|
|
1166
|
-
if (!this._listeners) {
|
|
1167
|
-
return;
|
|
1168
|
-
}
|
|
1169
|
-
var index = this._listeners.indexOf(listener);
|
|
1170
|
-
if (index !== -1) {
|
|
1171
|
-
this._listeners.splice(index, 1);
|
|
1172
|
-
}
|
|
1173
|
-
};
|
|
1174
1221
|
CancelToken.source = function source() {
|
|
1175
1222
|
var cancel;
|
|
1176
1223
|
var token = new CancelToken(function executor(c) {
|
|
@@ -1200,17 +1247,16 @@ function createInstance(defaultConfig) {
|
|
|
1200
1247
|
var instance2 = bind$2(Axios.prototype.request, context);
|
|
1201
1248
|
utils$3.extend(instance2, Axios.prototype, context);
|
|
1202
1249
|
utils$3.extend(instance2, context);
|
|
1203
|
-
instance2.create = function create(instanceConfig) {
|
|
1204
|
-
return createInstance(mergeConfig2(defaultConfig, instanceConfig));
|
|
1205
|
-
};
|
|
1206
1250
|
return instance2;
|
|
1207
1251
|
}
|
|
1208
1252
|
var axios$1 = createInstance(defaults$2);
|
|
1209
1253
|
axios$1.Axios = Axios;
|
|
1254
|
+
axios$1.create = function create(instanceConfig) {
|
|
1255
|
+
return createInstance(mergeConfig2(axios$1.defaults, instanceConfig));
|
|
1256
|
+
};
|
|
1210
1257
|
axios$1.Cancel = Cancel_1;
|
|
1211
1258
|
axios$1.CancelToken = CancelToken_1;
|
|
1212
1259
|
axios$1.isCancel = isCancel$1;
|
|
1213
|
-
axios$1.VERSION = data.version;
|
|
1214
1260
|
axios$1.all = function all(promises) {
|
|
1215
1261
|
return Promise.all(promises);
|
|
1216
1262
|
};
|
|
@@ -1479,26 +1525,26 @@ if (getProto) {
|
|
|
1479
1525
|
INTRINSICS["%Error.prototype%"] = errorProto;
|
|
1480
1526
|
}
|
|
1481
1527
|
}
|
|
1482
|
-
var doEval = function doEval2(
|
|
1528
|
+
var doEval = function doEval2(name2) {
|
|
1483
1529
|
var value;
|
|
1484
|
-
if (
|
|
1530
|
+
if (name2 === "%AsyncFunction%") {
|
|
1485
1531
|
value = getEvalledConstructor("async function () {}");
|
|
1486
|
-
} else if (
|
|
1532
|
+
} else if (name2 === "%GeneratorFunction%") {
|
|
1487
1533
|
value = getEvalledConstructor("function* () {}");
|
|
1488
|
-
} else if (
|
|
1534
|
+
} else if (name2 === "%AsyncGeneratorFunction%") {
|
|
1489
1535
|
value = getEvalledConstructor("async function* () {}");
|
|
1490
|
-
} else if (
|
|
1536
|
+
} else if (name2 === "%AsyncGenerator%") {
|
|
1491
1537
|
var fn = doEval2("%AsyncGeneratorFunction%");
|
|
1492
1538
|
if (fn) {
|
|
1493
1539
|
value = fn.prototype;
|
|
1494
1540
|
}
|
|
1495
|
-
} else if (
|
|
1541
|
+
} else if (name2 === "%AsyncIteratorPrototype%") {
|
|
1496
1542
|
var gen = doEval2("%AsyncGenerator%");
|
|
1497
1543
|
if (gen && getProto) {
|
|
1498
1544
|
value = getProto(gen.prototype);
|
|
1499
1545
|
}
|
|
1500
1546
|
}
|
|
1501
|
-
INTRINSICS[
|
|
1547
|
+
INTRINSICS[name2] = value;
|
|
1502
1548
|
return value;
|
|
1503
1549
|
};
|
|
1504
1550
|
var LEGACY_ALIASES = {
|
|
@@ -1577,8 +1623,8 @@ var stringToPath = function stringToPath2(string) {
|
|
|
1577
1623
|
});
|
|
1578
1624
|
return result;
|
|
1579
1625
|
};
|
|
1580
|
-
var getBaseIntrinsic = function getBaseIntrinsic2(
|
|
1581
|
-
var intrinsicName =
|
|
1626
|
+
var getBaseIntrinsic = function getBaseIntrinsic2(name2, allowMissing) {
|
|
1627
|
+
var intrinsicName = name2;
|
|
1582
1628
|
var alias;
|
|
1583
1629
|
if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
|
|
1584
1630
|
alias = LEGACY_ALIASES[intrinsicName];
|
|
@@ -1590,7 +1636,7 @@ var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
|
|
|
1590
1636
|
value = doEval(intrinsicName);
|
|
1591
1637
|
}
|
|
1592
1638
|
if (typeof value === "undefined" && !allowMissing) {
|
|
1593
|
-
throw new $TypeError$3("intrinsic " +
|
|
1639
|
+
throw new $TypeError$3("intrinsic " + name2 + " exists, but is not available. Please file an issue!");
|
|
1594
1640
|
}
|
|
1595
1641
|
return {
|
|
1596
1642
|
alias,
|
|
@@ -1598,19 +1644,19 @@ var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) {
|
|
|
1598
1644
|
value
|
|
1599
1645
|
};
|
|
1600
1646
|
}
|
|
1601
|
-
throw new $SyntaxError$1("intrinsic " +
|
|
1647
|
+
throw new $SyntaxError$1("intrinsic " + name2 + " does not exist!");
|
|
1602
1648
|
};
|
|
1603
|
-
var getIntrinsic = function GetIntrinsic(
|
|
1604
|
-
if (typeof
|
|
1649
|
+
var getIntrinsic = function GetIntrinsic(name2, allowMissing) {
|
|
1650
|
+
if (typeof name2 !== "string" || name2.length === 0) {
|
|
1605
1651
|
throw new $TypeError$3("intrinsic name must be a non-empty string");
|
|
1606
1652
|
}
|
|
1607
1653
|
if (arguments.length > 1 && typeof allowMissing !== "boolean") {
|
|
1608
1654
|
throw new $TypeError$3('"allowMissing" argument must be a boolean');
|
|
1609
1655
|
}
|
|
1610
|
-
if ($exec(/^%?[^%]*%?$/,
|
|
1656
|
+
if ($exec(/^%?[^%]*%?$/, name2) === null) {
|
|
1611
1657
|
throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
1612
1658
|
}
|
|
1613
|
-
var parts = stringToPath(
|
|
1659
|
+
var parts = stringToPath(name2);
|
|
1614
1660
|
var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
|
|
1615
1661
|
var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
|
|
1616
1662
|
var intrinsicRealName = intrinsic.name;
|
|
@@ -1638,7 +1684,7 @@ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
|
1638
1684
|
} else if (value != null) {
|
|
1639
1685
|
if (!(part in value)) {
|
|
1640
1686
|
if (!allowMissing) {
|
|
1641
|
-
throw new $TypeError$3("base intrinsic for " +
|
|
1687
|
+
throw new $TypeError$3("base intrinsic for " + name2 + " exists, but the property is not available.");
|
|
1642
1688
|
}
|
|
1643
1689
|
return void 0;
|
|
1644
1690
|
}
|
|
@@ -1820,9 +1866,9 @@ var setFunctionLength = function setFunctionLength2(fn, length) {
|
|
|
1820
1866
|
var GetIntrinsic$1 = getIntrinsic;
|
|
1821
1867
|
var callBind = callBind$1.exports;
|
|
1822
1868
|
var $indexOf = callBind(GetIntrinsic$1("String.prototype.indexOf"));
|
|
1823
|
-
var callBound$1 = function callBoundIntrinsic(
|
|
1824
|
-
var intrinsic = GetIntrinsic$1(
|
|
1825
|
-
if (typeof intrinsic === "function" && $indexOf(
|
|
1869
|
+
var callBound$1 = function callBoundIntrinsic(name2, allowMissing) {
|
|
1870
|
+
var intrinsic = GetIntrinsic$1(name2, !!allowMissing);
|
|
1871
|
+
if (typeof intrinsic === "function" && $indexOf(name2, ".prototype.") > -1) {
|
|
1826
1872
|
return callBind(intrinsic);
|
|
1827
1873
|
}
|
|
1828
1874
|
return intrinsic;
|
|
@@ -1959,9 +2005,9 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
|
1959
2005
|
return inspect_(value, opts, depth + 1, seen);
|
|
1960
2006
|
}
|
|
1961
2007
|
if (typeof obj === "function" && !isRegExp$2(obj)) {
|
|
1962
|
-
var
|
|
2008
|
+
var name2 = nameOf(obj);
|
|
1963
2009
|
var keys = arrObjKeys(obj, inspect2);
|
|
1964
|
-
return "[Function" + (
|
|
2010
|
+
return "[Function" + (name2 ? ": " + name2 : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
|
|
1965
2011
|
}
|
|
1966
2012
|
if (isSymbol(obj)) {
|
|
1967
2013
|
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
|
|
@@ -2490,7 +2536,7 @@ var compactQueue = function compactQueue2(queue) {
|
|
|
2490
2536
|
}
|
|
2491
2537
|
};
|
|
2492
2538
|
var arrayToObject = function arrayToObject2(source2, options) {
|
|
2493
|
-
var obj = options && options.plainObjects ?
|
|
2539
|
+
var obj = options && options.plainObjects ? { __proto__: null } : {};
|
|
2494
2540
|
for (var i = 0; i < source2.length; ++i) {
|
|
2495
2541
|
if (typeof source2[i] !== "undefined") {
|
|
2496
2542
|
obj[i] = source2[i];
|
|
@@ -2502,7 +2548,7 @@ var merge = function merge2(target, source2, options) {
|
|
|
2502
2548
|
if (!source2) {
|
|
2503
2549
|
return target;
|
|
2504
2550
|
}
|
|
2505
|
-
if (typeof source2 !== "object") {
|
|
2551
|
+
if (typeof source2 !== "object" && typeof source2 !== "function") {
|
|
2506
2552
|
if (isArray$3(target)) {
|
|
2507
2553
|
target.push(source2);
|
|
2508
2554
|
} else if (target && typeof target === "object") {
|
|
@@ -2552,7 +2598,7 @@ var assign = function assignSingleSource(target, source2) {
|
|
|
2552
2598
|
return acc;
|
|
2553
2599
|
}, target);
|
|
2554
2600
|
};
|
|
2555
|
-
var decode = function(str,
|
|
2601
|
+
var decode = function(str, defaultDecoder, charset) {
|
|
2556
2602
|
var strWithoutPlus = str.replace(/\+/g, " ");
|
|
2557
2603
|
if (charset === "iso-8859-1") {
|
|
2558
2604
|
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
@@ -2563,6 +2609,7 @@ var decode = function(str, decoder, charset) {
|
|
|
2563
2609
|
return strWithoutPlus;
|
|
2564
2610
|
}
|
|
2565
2611
|
};
|
|
2612
|
+
var limit = 1024;
|
|
2566
2613
|
var encode = function encode2(str, defaultEncoder, charset, kind, format) {
|
|
2567
2614
|
if (str.length === 0) {
|
|
2568
2615
|
return str;
|
|
@@ -2579,27 +2626,32 @@ var encode = function encode2(str, defaultEncoder, charset, kind, format) {
|
|
|
2579
2626
|
});
|
|
2580
2627
|
}
|
|
2581
2628
|
var out = "";
|
|
2582
|
-
for (var
|
|
2583
|
-
var
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2629
|
+
for (var j = 0; j < string.length; j += limit) {
|
|
2630
|
+
var segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
2631
|
+
var arr = [];
|
|
2632
|
+
for (var i = 0; i < segment.length; ++i) {
|
|
2633
|
+
var c = segment.charCodeAt(i);
|
|
2634
|
+
if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats$2.RFC1738 && (c === 40 || c === 41)) {
|
|
2635
|
+
arr[arr.length] = segment.charAt(i);
|
|
2636
|
+
continue;
|
|
2637
|
+
}
|
|
2638
|
+
if (c < 128) {
|
|
2639
|
+
arr[arr.length] = hexTable[c];
|
|
2640
|
+
continue;
|
|
2641
|
+
}
|
|
2642
|
+
if (c < 2048) {
|
|
2643
|
+
arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
|
|
2644
|
+
continue;
|
|
2645
|
+
}
|
|
2646
|
+
if (c < 55296 || c >= 57344) {
|
|
2647
|
+
arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
2648
|
+
continue;
|
|
2649
|
+
}
|
|
2650
|
+
i += 1;
|
|
2651
|
+
c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
|
|
2652
|
+
arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
2599
2653
|
}
|
|
2600
|
-
|
|
2601
|
-
c = 65536 + ((c & 1023) << 10 | string.charCodeAt(i) & 1023);
|
|
2602
|
-
out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
2654
|
+
out += arr.join("");
|
|
2603
2655
|
}
|
|
2604
2656
|
return out;
|
|
2605
2657
|
};
|
|
@@ -2682,12 +2734,17 @@ var defaultFormat = formats$1["default"];
|
|
|
2682
2734
|
var defaults$1 = {
|
|
2683
2735
|
addQueryPrefix: false,
|
|
2684
2736
|
allowDots: false,
|
|
2737
|
+
allowEmptyArrays: false,
|
|
2738
|
+
arrayFormat: "indices",
|
|
2685
2739
|
charset: "utf-8",
|
|
2686
2740
|
charsetSentinel: false,
|
|
2741
|
+
commaRoundTrip: false,
|
|
2687
2742
|
delimiter: "&",
|
|
2688
2743
|
encode: true,
|
|
2744
|
+
encodeDotInKeys: false,
|
|
2689
2745
|
encoder: utils$1.encode,
|
|
2690
2746
|
encodeValuesOnly: false,
|
|
2747
|
+
filter: void 0,
|
|
2691
2748
|
format: defaultFormat,
|
|
2692
2749
|
formatter: formats$1.formatters[defaultFormat],
|
|
2693
2750
|
indices: false,
|
|
@@ -2701,7 +2758,7 @@ var isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
|
|
|
2701
2758
|
return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
|
|
2702
2759
|
};
|
|
2703
2760
|
var sentinel = {};
|
|
2704
|
-
var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly, charset, sideChannel2) {
|
|
2761
|
+
var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly, charset, sideChannel2) {
|
|
2705
2762
|
var obj = object;
|
|
2706
2763
|
var tmpSc = sideChannel2;
|
|
2707
2764
|
var step = 0;
|
|
@@ -2761,14 +2818,19 @@ var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaR
|
|
|
2761
2818
|
var keys = Object.keys(obj);
|
|
2762
2819
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
2763
2820
|
}
|
|
2764
|
-
var
|
|
2821
|
+
var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
|
|
2822
|
+
var adjustedPrefix = commaRoundTrip && isArray$2(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
|
|
2823
|
+
if (allowEmptyArrays && isArray$2(obj) && obj.length === 0) {
|
|
2824
|
+
return adjustedPrefix + "[]";
|
|
2825
|
+
}
|
|
2765
2826
|
for (var j = 0; j < objKeys.length; ++j) {
|
|
2766
2827
|
var key = objKeys[j];
|
|
2767
|
-
var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key];
|
|
2828
|
+
var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
|
|
2768
2829
|
if (skipNulls && value === null) {
|
|
2769
2830
|
continue;
|
|
2770
2831
|
}
|
|
2771
|
-
var
|
|
2832
|
+
var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
|
|
2833
|
+
var keyPrefix = isArray$2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
|
|
2772
2834
|
sideChannel2.set(object, step);
|
|
2773
2835
|
var valueSideChannel = getSideChannel2();
|
|
2774
2836
|
valueSideChannel.set(sentinel, sideChannel2);
|
|
@@ -2777,8 +2839,10 @@ var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaR
|
|
|
2777
2839
|
keyPrefix,
|
|
2778
2840
|
generateArrayPrefix,
|
|
2779
2841
|
commaRoundTrip,
|
|
2842
|
+
allowEmptyArrays,
|
|
2780
2843
|
strictNullHandling,
|
|
2781
2844
|
skipNulls,
|
|
2845
|
+
encodeDotInKeys,
|
|
2782
2846
|
generateArrayPrefix === "comma" && encodeValuesOnly && isArray$2(obj) ? null : encoder,
|
|
2783
2847
|
filter,
|
|
2784
2848
|
sort,
|
|
@@ -2797,6 +2861,12 @@ var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
|
|
|
2797
2861
|
if (!opts) {
|
|
2798
2862
|
return defaults$1;
|
|
2799
2863
|
}
|
|
2864
|
+
if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
|
|
2865
|
+
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
2866
|
+
}
|
|
2867
|
+
if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
|
|
2868
|
+
throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
2869
|
+
}
|
|
2800
2870
|
if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
|
|
2801
2871
|
throw new TypeError("Encoder has to be a function.");
|
|
2802
2872
|
}
|
|
@@ -2816,13 +2886,29 @@ var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
|
|
|
2816
2886
|
if (typeof opts.filter === "function" || isArray$2(opts.filter)) {
|
|
2817
2887
|
filter = opts.filter;
|
|
2818
2888
|
}
|
|
2889
|
+
var arrayFormat;
|
|
2890
|
+
if (opts.arrayFormat in arrayPrefixGenerators) {
|
|
2891
|
+
arrayFormat = opts.arrayFormat;
|
|
2892
|
+
} else if ("indices" in opts) {
|
|
2893
|
+
arrayFormat = opts.indices ? "indices" : "repeat";
|
|
2894
|
+
} else {
|
|
2895
|
+
arrayFormat = defaults$1.arrayFormat;
|
|
2896
|
+
}
|
|
2897
|
+
if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
|
|
2898
|
+
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
2899
|
+
}
|
|
2900
|
+
var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults$1.allowDots : !!opts.allowDots;
|
|
2819
2901
|
return {
|
|
2820
2902
|
addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
|
|
2821
|
-
allowDots
|
|
2903
|
+
allowDots,
|
|
2904
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults$1.allowEmptyArrays,
|
|
2905
|
+
arrayFormat,
|
|
2822
2906
|
charset,
|
|
2823
2907
|
charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
2908
|
+
commaRoundTrip: !!opts.commaRoundTrip,
|
|
2824
2909
|
delimiter: typeof opts.delimiter === "undefined" ? defaults$1.delimiter : opts.delimiter,
|
|
2825
2910
|
encode: typeof opts.encode === "boolean" ? opts.encode : defaults$1.encode,
|
|
2911
|
+
encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults$1.encodeDotInKeys,
|
|
2826
2912
|
encoder: typeof opts.encoder === "function" ? opts.encoder : defaults$1.encoder,
|
|
2827
2913
|
encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
|
|
2828
2914
|
filter,
|
|
@@ -2850,19 +2936,8 @@ var stringify_1 = function(object, opts) {
|
|
|
2850
2936
|
if (typeof obj !== "object" || obj === null) {
|
|
2851
2937
|
return "";
|
|
2852
2938
|
}
|
|
2853
|
-
var arrayFormat;
|
|
2854
|
-
|
|
2855
|
-
arrayFormat = opts.arrayFormat;
|
|
2856
|
-
} else if (opts && "indices" in opts) {
|
|
2857
|
-
arrayFormat = opts.indices ? "indices" : "repeat";
|
|
2858
|
-
} else {
|
|
2859
|
-
arrayFormat = "indices";
|
|
2860
|
-
}
|
|
2861
|
-
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
2862
|
-
if (opts && "commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
|
|
2863
|
-
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
2864
|
-
}
|
|
2865
|
-
var commaRoundTrip = generateArrayPrefix === "comma" && opts && opts.commaRoundTrip;
|
|
2939
|
+
var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
|
|
2940
|
+
var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
|
|
2866
2941
|
if (!objKeys) {
|
|
2867
2942
|
objKeys = Object.keys(obj);
|
|
2868
2943
|
}
|
|
@@ -2872,16 +2947,19 @@ var stringify_1 = function(object, opts) {
|
|
|
2872
2947
|
var sideChannel2 = getSideChannel2();
|
|
2873
2948
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
2874
2949
|
var key = objKeys[i];
|
|
2875
|
-
|
|
2950
|
+
var value = obj[key];
|
|
2951
|
+
if (options.skipNulls && value === null) {
|
|
2876
2952
|
continue;
|
|
2877
2953
|
}
|
|
2878
2954
|
pushToArray(keys, stringify$1(
|
|
2879
|
-
|
|
2955
|
+
value,
|
|
2880
2956
|
key,
|
|
2881
2957
|
generateArrayPrefix,
|
|
2882
2958
|
commaRoundTrip,
|
|
2959
|
+
options.allowEmptyArrays,
|
|
2883
2960
|
options.strictNullHandling,
|
|
2884
2961
|
options.skipNulls,
|
|
2962
|
+
options.encodeDotInKeys,
|
|
2885
2963
|
options.encode ? options.encoder : null,
|
|
2886
2964
|
options.filter,
|
|
2887
2965
|
options.sort,
|
|
@@ -2910,31 +2988,39 @@ var has = Object.prototype.hasOwnProperty;
|
|
|
2910
2988
|
var isArray$1 = Array.isArray;
|
|
2911
2989
|
var defaults = {
|
|
2912
2990
|
allowDots: false,
|
|
2991
|
+
allowEmptyArrays: false,
|
|
2913
2992
|
allowPrototypes: false,
|
|
2914
2993
|
allowSparse: false,
|
|
2915
2994
|
arrayLimit: 20,
|
|
2916
2995
|
charset: "utf-8",
|
|
2917
2996
|
charsetSentinel: false,
|
|
2918
2997
|
comma: false,
|
|
2998
|
+
decodeDotInKeys: false,
|
|
2919
2999
|
decoder: utils.decode,
|
|
2920
3000
|
delimiter: "&",
|
|
2921
3001
|
depth: 5,
|
|
3002
|
+
duplicates: "combine",
|
|
2922
3003
|
ignoreQueryPrefix: false,
|
|
2923
3004
|
interpretNumericEntities: false,
|
|
2924
3005
|
parameterLimit: 1e3,
|
|
2925
3006
|
parseArrays: true,
|
|
2926
3007
|
plainObjects: false,
|
|
2927
|
-
|
|
3008
|
+
strictDepth: false,
|
|
3009
|
+
strictNullHandling: false,
|
|
3010
|
+
throwOnLimitExceeded: false
|
|
2928
3011
|
};
|
|
2929
3012
|
var interpretNumericEntities = function(str) {
|
|
2930
3013
|
return str.replace(/&#(\d+);/g, function($0, numberStr) {
|
|
2931
3014
|
return String.fromCharCode(parseInt(numberStr, 10));
|
|
2932
3015
|
});
|
|
2933
3016
|
};
|
|
2934
|
-
var parseArrayValue = function(val, options) {
|
|
3017
|
+
var parseArrayValue = function(val, options, currentArrayLength) {
|
|
2935
3018
|
if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
|
|
2936
3019
|
return val.split(",");
|
|
2937
3020
|
}
|
|
3021
|
+
if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
|
|
3022
|
+
throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
|
|
3023
|
+
}
|
|
2938
3024
|
return val;
|
|
2939
3025
|
};
|
|
2940
3026
|
var isoSentinel = "utf8=%26%2310003%3B";
|
|
@@ -2942,8 +3028,15 @@ var charsetSentinel = "utf8=%E2%9C%93";
|
|
|
2942
3028
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
2943
3029
|
var obj = { __proto__: null };
|
|
2944
3030
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
2945
|
-
|
|
2946
|
-
var
|
|
3031
|
+
cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
3032
|
+
var limit2 = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
3033
|
+
var parts = cleanStr.split(
|
|
3034
|
+
options.delimiter,
|
|
3035
|
+
options.throwOnLimitExceeded ? limit2 + 1 : limit2
|
|
3036
|
+
);
|
|
3037
|
+
if (options.throwOnLimitExceeded && parts.length > limit2) {
|
|
3038
|
+
throw new RangeError("Parameter limit exceeded. Only " + limit2 + " parameter" + (limit2 === 1 ? "" : "s") + " allowed.");
|
|
3039
|
+
}
|
|
2947
3040
|
var skipIndex = -1;
|
|
2948
3041
|
var i;
|
|
2949
3042
|
var charset = options.charset;
|
|
@@ -2967,51 +3060,63 @@ var parseValues = function parseQueryStringValues(str, options) {
|
|
|
2967
3060
|
var part = parts[i];
|
|
2968
3061
|
var bracketEqualsPos = part.indexOf("]=");
|
|
2969
3062
|
var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
|
|
2970
|
-
var key
|
|
3063
|
+
var key;
|
|
3064
|
+
var val;
|
|
2971
3065
|
if (pos === -1) {
|
|
2972
3066
|
key = options.decoder(part, defaults.decoder, charset, "key");
|
|
2973
3067
|
val = options.strictNullHandling ? null : "";
|
|
2974
3068
|
} else {
|
|
2975
3069
|
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
|
|
2976
3070
|
val = utils.maybeMap(
|
|
2977
|
-
parseArrayValue(
|
|
3071
|
+
parseArrayValue(
|
|
3072
|
+
part.slice(pos + 1),
|
|
3073
|
+
options,
|
|
3074
|
+
isArray$1(obj[key]) ? obj[key].length : 0
|
|
3075
|
+
),
|
|
2978
3076
|
function(encodedVal) {
|
|
2979
3077
|
return options.decoder(encodedVal, defaults.decoder, charset, "value");
|
|
2980
3078
|
}
|
|
2981
3079
|
);
|
|
2982
3080
|
}
|
|
2983
3081
|
if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
|
|
2984
|
-
val = interpretNumericEntities(val);
|
|
3082
|
+
val = interpretNumericEntities(String(val));
|
|
2985
3083
|
}
|
|
2986
3084
|
if (part.indexOf("[]=") > -1) {
|
|
2987
3085
|
val = isArray$1(val) ? [val] : val;
|
|
2988
3086
|
}
|
|
2989
|
-
|
|
3087
|
+
var existing = has.call(obj, key);
|
|
3088
|
+
if (existing && options.duplicates === "combine") {
|
|
2990
3089
|
obj[key] = utils.combine(obj[key], val);
|
|
2991
|
-
} else {
|
|
3090
|
+
} else if (!existing || options.duplicates === "last") {
|
|
2992
3091
|
obj[key] = val;
|
|
2993
3092
|
}
|
|
2994
3093
|
}
|
|
2995
3094
|
return obj;
|
|
2996
3095
|
};
|
|
2997
3096
|
var parseObject = function(chain, val, options, valuesParsed) {
|
|
2998
|
-
var
|
|
3097
|
+
var currentArrayLength = 0;
|
|
3098
|
+
if (chain.length > 0 && chain[chain.length - 1] === "[]") {
|
|
3099
|
+
var parentKey = chain.slice(0, -1).join("");
|
|
3100
|
+
currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
|
|
3101
|
+
}
|
|
3102
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
|
|
2999
3103
|
for (var i = chain.length - 1; i >= 0; --i) {
|
|
3000
3104
|
var obj;
|
|
3001
3105
|
var root = chain[i];
|
|
3002
3106
|
if (root === "[]" && options.parseArrays) {
|
|
3003
|
-
obj = [].
|
|
3107
|
+
obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf);
|
|
3004
3108
|
} else {
|
|
3005
|
-
obj = options.plainObjects ?
|
|
3109
|
+
obj = options.plainObjects ? { __proto__: null } : {};
|
|
3006
3110
|
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
3007
|
-
var
|
|
3008
|
-
|
|
3111
|
+
var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
|
|
3112
|
+
var index = parseInt(decodedRoot, 10);
|
|
3113
|
+
if (!options.parseArrays && decodedRoot === "") {
|
|
3009
3114
|
obj = { 0: leaf };
|
|
3010
|
-
} else if (!isNaN(index) && root !==
|
|
3115
|
+
} else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) {
|
|
3011
3116
|
obj = [];
|
|
3012
3117
|
obj[index] = leaf;
|
|
3013
|
-
} else if (
|
|
3014
|
-
obj[
|
|
3118
|
+
} else if (decodedRoot !== "__proto__") {
|
|
3119
|
+
obj[decodedRoot] = leaf;
|
|
3015
3120
|
}
|
|
3016
3121
|
}
|
|
3017
3122
|
leaf = obj;
|
|
@@ -3047,6 +3152,9 @@ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesPars
|
|
|
3047
3152
|
keys.push(segment[1]);
|
|
3048
3153
|
}
|
|
3049
3154
|
if (segment) {
|
|
3155
|
+
if (options.strictDepth === true) {
|
|
3156
|
+
throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
|
|
3157
|
+
}
|
|
3050
3158
|
keys.push("[" + key.slice(segment.index) + "]");
|
|
3051
3159
|
}
|
|
3052
3160
|
return parseObject(keys, val, options, valuesParsed);
|
|
@@ -3055,39 +3163,58 @@ var normalizeParseOptions = function normalizeParseOptions2(opts) {
|
|
|
3055
3163
|
if (!opts) {
|
|
3056
3164
|
return defaults;
|
|
3057
3165
|
}
|
|
3058
|
-
if (
|
|
3166
|
+
if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
|
|
3167
|
+
throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
|
|
3168
|
+
}
|
|
3169
|
+
if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
|
|
3170
|
+
throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
|
|
3171
|
+
}
|
|
3172
|
+
if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
|
|
3059
3173
|
throw new TypeError("Decoder has to be a function.");
|
|
3060
3174
|
}
|
|
3061
3175
|
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
|
|
3062
3176
|
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
3063
3177
|
}
|
|
3178
|
+
if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") {
|
|
3179
|
+
throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
|
|
3180
|
+
}
|
|
3064
3181
|
var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
|
|
3182
|
+
var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
|
|
3183
|
+
if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
|
|
3184
|
+
throw new TypeError("The duplicates option must be either combine, first, or last");
|
|
3185
|
+
}
|
|
3186
|
+
var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
|
|
3065
3187
|
return {
|
|
3066
|
-
allowDots
|
|
3188
|
+
allowDots,
|
|
3189
|
+
allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
|
|
3067
3190
|
allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
3068
3191
|
allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
|
|
3069
3192
|
arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
|
|
3070
3193
|
charset,
|
|
3071
3194
|
charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
3072
3195
|
comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
|
|
3196
|
+
decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
|
|
3073
3197
|
decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
|
|
3074
3198
|
delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
3075
3199
|
depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
|
|
3200
|
+
duplicates,
|
|
3076
3201
|
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
3077
3202
|
interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
3078
3203
|
parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
|
|
3079
3204
|
parseArrays: opts.parseArrays !== false,
|
|
3080
3205
|
plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
|
|
3081
|
-
|
|
3206
|
+
strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
|
|
3207
|
+
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling,
|
|
3208
|
+
throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === "boolean" ? opts.throwOnLimitExceeded : false
|
|
3082
3209
|
};
|
|
3083
3210
|
};
|
|
3084
3211
|
var parse$1 = function(str, opts) {
|
|
3085
3212
|
var options = normalizeParseOptions(opts);
|
|
3086
3213
|
if (str === "" || str === null || typeof str === "undefined") {
|
|
3087
|
-
return options.plainObjects ?
|
|
3214
|
+
return options.plainObjects ? { __proto__: null } : {};
|
|
3088
3215
|
}
|
|
3089
3216
|
var tempObj = typeof str === "string" ? parseValues(str, options) : str;
|
|
3090
|
-
var obj = options.plainObjects ?
|
|
3217
|
+
var obj = options.plainObjects ? { __proto__: null } : {};
|
|
3091
3218
|
var keys = Object.keys(tempObj);
|
|
3092
3219
|
for (var i = 0; i < keys.length; ++i) {
|
|
3093
3220
|
var key = keys[i];
|
|
@@ -3107,6 +3234,7 @@ var lib = {
|
|
|
3107
3234
|
parse,
|
|
3108
3235
|
stringify: stringify2
|
|
3109
3236
|
};
|
|
3237
|
+
var qs = lib;
|
|
3110
3238
|
function getUrlParams() {
|
|
3111
3239
|
const url = location.search;
|
|
3112
3240
|
const theRequest = new Object();
|
|
@@ -3266,31 +3394,30 @@ function requestInterceptors(config2) {
|
|
|
3266
3394
|
const contentType = getContentType(config2.headers);
|
|
3267
3395
|
if (config2.method === "post") {
|
|
3268
3396
|
if (contentType === CONTENT_TYPE.form) {
|
|
3269
|
-
config2.data =
|
|
3397
|
+
config2.data = qs.stringify(config2.data);
|
|
3270
3398
|
}
|
|
3271
|
-
}
|
|
3272
|
-
;
|
|
3399
|
+
}
|
|
3273
3400
|
return config2;
|
|
3274
3401
|
}
|
|
3275
3402
|
function responseInterceptors(response) {
|
|
3276
3403
|
var _a;
|
|
3277
|
-
let
|
|
3404
|
+
let data = response.data;
|
|
3278
3405
|
const contentType = getContentType(response.headers);
|
|
3279
3406
|
if (contentType !== CONTENT_TYPE.json) {
|
|
3280
|
-
return
|
|
3407
|
+
return data;
|
|
3281
3408
|
}
|
|
3282
3409
|
if (typeof response.data === "string") {
|
|
3283
|
-
|
|
3410
|
+
data = JSON.parse(response.data);
|
|
3284
3411
|
}
|
|
3285
|
-
const code =
|
|
3412
|
+
const code = data.code;
|
|
3286
3413
|
switch (code) {
|
|
3287
3414
|
case SUCCESS_CODE: {
|
|
3288
|
-
if (sessionStorage.getItem("isFromIM") == "1" && ((_a =
|
|
3415
|
+
if (sessionStorage.getItem("isFromIM") == "1" && ((_a = data == null ? void 0 : data.extInfo) == null ? void 0 : _a.handleTask)) {
|
|
3289
3416
|
if (typeof window.native != "undefined") {
|
|
3290
3417
|
window.native.goHome();
|
|
3291
3418
|
}
|
|
3292
3419
|
}
|
|
3293
|
-
return
|
|
3420
|
+
return data;
|
|
3294
3421
|
}
|
|
3295
3422
|
case NO_SESSION_CODE: {
|
|
3296
3423
|
_debounce(function() {
|
|
@@ -3299,11 +3426,11 @@ function responseInterceptors(response) {
|
|
|
3299
3426
|
break;
|
|
3300
3427
|
}
|
|
3301
3428
|
default: {
|
|
3302
|
-
let msg =
|
|
3429
|
+
let msg = data.message || data.msg || config.errorMessage;
|
|
3303
3430
|
window.apiErrorHandler && window.apiErrorHandler(msg);
|
|
3304
3431
|
}
|
|
3305
3432
|
}
|
|
3306
|
-
return Promise.reject(
|
|
3433
|
+
return Promise.reject(data);
|
|
3307
3434
|
}
|
|
3308
3435
|
function inspectorError(error) {
|
|
3309
3436
|
var _a;
|
|
@@ -3317,10 +3444,10 @@ function inspectorError(error) {
|
|
|
3317
3444
|
const instance = axios.create({ timeout: 5 * 60 * 1e3 });
|
|
3318
3445
|
instance.interceptors.request.use(requestInterceptors, inspectorError);
|
|
3319
3446
|
instance.interceptors.response.use(responseInterceptors, inspectorError);
|
|
3320
|
-
instance.formPost = function(url,
|
|
3447
|
+
instance.formPost = function(url, data, config2) {
|
|
3321
3448
|
const headers = (config2 == null ? void 0 : config2.headers) || {};
|
|
3322
3449
|
setContentType(headers, CONTENT_TYPE.form);
|
|
3323
|
-
return instance.post(url,
|
|
3450
|
+
return instance.post(url, data, __spreadProps(__spreadValues({}, config2), { headers }));
|
|
3324
3451
|
};
|
|
3325
3452
|
const wrapApi = (api, isPost = false) => {
|
|
3326
3453
|
let currentController = null;
|
|
@@ -4371,7 +4498,7 @@ var lodash = { exports: {} };
|
|
|
4371
4498
|
(function(module, exports) {
|
|
4372
4499
|
(function() {
|
|
4373
4500
|
var undefined$12;
|
|
4374
|
-
var
|
|
4501
|
+
var VERSION = "4.17.21";
|
|
4375
4502
|
var LARGE_ARRAY_SIZE = 200;
|
|
4376
4503
|
var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
|
|
4377
4504
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
@@ -4966,9 +5093,9 @@ var lodash = { exports: {} };
|
|
|
4966
5093
|
return reHasUnicodeWord.test(string);
|
|
4967
5094
|
}
|
|
4968
5095
|
function iteratorToArray(iterator) {
|
|
4969
|
-
var
|
|
4970
|
-
while (!(
|
|
4971
|
-
result.push(
|
|
5096
|
+
var data, result = [];
|
|
5097
|
+
while (!(data = iterator.next()).done) {
|
|
5098
|
+
result.push(data.value);
|
|
4972
5099
|
}
|
|
4973
5100
|
return result;
|
|
4974
5101
|
}
|
|
@@ -5177,7 +5304,7 @@ var lodash = { exports: {} };
|
|
|
5177
5304
|
index += dir;
|
|
5178
5305
|
var iterIndex = -1, value = array[index];
|
|
5179
5306
|
while (++iterIndex < iterLength) {
|
|
5180
|
-
var
|
|
5307
|
+
var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
|
|
5181
5308
|
if (type == LAZY_MAP_FLAG) {
|
|
5182
5309
|
value = computed;
|
|
5183
5310
|
} else if (!computed) {
|
|
@@ -5212,21 +5339,21 @@ var lodash = { exports: {} };
|
|
|
5212
5339
|
return result2;
|
|
5213
5340
|
}
|
|
5214
5341
|
function hashGet(key) {
|
|
5215
|
-
var
|
|
5342
|
+
var data = this.__data__;
|
|
5216
5343
|
if (nativeCreate) {
|
|
5217
|
-
var result2 =
|
|
5344
|
+
var result2 = data[key];
|
|
5218
5345
|
return result2 === HASH_UNDEFINED ? undefined$12 : result2;
|
|
5219
5346
|
}
|
|
5220
|
-
return hasOwnProperty2.call(
|
|
5347
|
+
return hasOwnProperty2.call(data, key) ? data[key] : undefined$12;
|
|
5221
5348
|
}
|
|
5222
5349
|
function hashHas(key) {
|
|
5223
|
-
var
|
|
5224
|
-
return nativeCreate ?
|
|
5350
|
+
var data = this.__data__;
|
|
5351
|
+
return nativeCreate ? data[key] !== undefined$12 : hasOwnProperty2.call(data, key);
|
|
5225
5352
|
}
|
|
5226
5353
|
function hashSet(key, value) {
|
|
5227
|
-
var
|
|
5354
|
+
var data = this.__data__;
|
|
5228
5355
|
this.size += this.has(key) ? 0 : 1;
|
|
5229
|
-
|
|
5356
|
+
data[key] = nativeCreate && value === undefined$12 ? HASH_UNDEFINED : value;
|
|
5230
5357
|
return this;
|
|
5231
5358
|
}
|
|
5232
5359
|
Hash.prototype.clear = hashClear;
|
|
@@ -5247,33 +5374,33 @@ var lodash = { exports: {} };
|
|
|
5247
5374
|
this.size = 0;
|
|
5248
5375
|
}
|
|
5249
5376
|
function listCacheDelete(key) {
|
|
5250
|
-
var
|
|
5377
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
5251
5378
|
if (index < 0) {
|
|
5252
5379
|
return false;
|
|
5253
5380
|
}
|
|
5254
|
-
var lastIndex =
|
|
5381
|
+
var lastIndex = data.length - 1;
|
|
5255
5382
|
if (index == lastIndex) {
|
|
5256
|
-
|
|
5383
|
+
data.pop();
|
|
5257
5384
|
} else {
|
|
5258
|
-
splice.call(
|
|
5385
|
+
splice.call(data, index, 1);
|
|
5259
5386
|
}
|
|
5260
5387
|
--this.size;
|
|
5261
5388
|
return true;
|
|
5262
5389
|
}
|
|
5263
5390
|
function listCacheGet(key) {
|
|
5264
|
-
var
|
|
5265
|
-
return index < 0 ? undefined$12 :
|
|
5391
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
5392
|
+
return index < 0 ? undefined$12 : data[index][1];
|
|
5266
5393
|
}
|
|
5267
5394
|
function listCacheHas(key) {
|
|
5268
5395
|
return assocIndexOf(this.__data__, key) > -1;
|
|
5269
5396
|
}
|
|
5270
5397
|
function listCacheSet(key, value) {
|
|
5271
|
-
var
|
|
5398
|
+
var data = this.__data__, index = assocIndexOf(data, key);
|
|
5272
5399
|
if (index < 0) {
|
|
5273
5400
|
++this.size;
|
|
5274
|
-
|
|
5401
|
+
data.push([key, value]);
|
|
5275
5402
|
} else {
|
|
5276
|
-
|
|
5403
|
+
data[index][1] = value;
|
|
5277
5404
|
}
|
|
5278
5405
|
return this;
|
|
5279
5406
|
}
|
|
@@ -5310,9 +5437,9 @@ var lodash = { exports: {} };
|
|
|
5310
5437
|
return getMapData(this, key).has(key);
|
|
5311
5438
|
}
|
|
5312
5439
|
function mapCacheSet(key, value) {
|
|
5313
|
-
var
|
|
5314
|
-
|
|
5315
|
-
this.size +=
|
|
5440
|
+
var data = getMapData(this, key), size2 = data.size;
|
|
5441
|
+
data.set(key, value);
|
|
5442
|
+
this.size += data.size == size2 ? 0 : 1;
|
|
5316
5443
|
return this;
|
|
5317
5444
|
}
|
|
5318
5445
|
MapCache.prototype.clear = mapCacheClear;
|
|
@@ -5337,16 +5464,16 @@ var lodash = { exports: {} };
|
|
|
5337
5464
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
5338
5465
|
SetCache.prototype.has = setCacheHas;
|
|
5339
5466
|
function Stack(entries) {
|
|
5340
|
-
var
|
|
5341
|
-
this.size =
|
|
5467
|
+
var data = this.__data__ = new ListCache(entries);
|
|
5468
|
+
this.size = data.size;
|
|
5342
5469
|
}
|
|
5343
5470
|
function stackClear() {
|
|
5344
5471
|
this.__data__ = new ListCache();
|
|
5345
5472
|
this.size = 0;
|
|
5346
5473
|
}
|
|
5347
5474
|
function stackDelete(key) {
|
|
5348
|
-
var
|
|
5349
|
-
this.size =
|
|
5475
|
+
var data = this.__data__, result2 = data["delete"](key);
|
|
5476
|
+
this.size = data.size;
|
|
5350
5477
|
return result2;
|
|
5351
5478
|
}
|
|
5352
5479
|
function stackGet(key) {
|
|
@@ -5356,18 +5483,18 @@ var lodash = { exports: {} };
|
|
|
5356
5483
|
return this.__data__.has(key);
|
|
5357
5484
|
}
|
|
5358
5485
|
function stackSet(key, value) {
|
|
5359
|
-
var
|
|
5360
|
-
if (
|
|
5361
|
-
var pairs =
|
|
5486
|
+
var data = this.__data__;
|
|
5487
|
+
if (data instanceof ListCache) {
|
|
5488
|
+
var pairs = data.__data__;
|
|
5362
5489
|
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
5363
5490
|
pairs.push([key, value]);
|
|
5364
|
-
this.size = ++
|
|
5491
|
+
this.size = ++data.size;
|
|
5365
5492
|
return this;
|
|
5366
5493
|
}
|
|
5367
|
-
|
|
5494
|
+
data = this.__data__ = new MapCache(pairs);
|
|
5368
5495
|
}
|
|
5369
|
-
|
|
5370
|
-
this.size =
|
|
5496
|
+
data.set(key, value);
|
|
5497
|
+
this.size = data.size;
|
|
5371
5498
|
return this;
|
|
5372
5499
|
}
|
|
5373
5500
|
Stack.prototype.clear = stackClear;
|
|
@@ -5786,15 +5913,15 @@ var lodash = { exports: {} };
|
|
|
5786
5913
|
}
|
|
5787
5914
|
object = Object2(object);
|
|
5788
5915
|
while (index--) {
|
|
5789
|
-
var
|
|
5790
|
-
if (noCustomizer &&
|
|
5916
|
+
var data = matchData[index];
|
|
5917
|
+
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
|
|
5791
5918
|
return false;
|
|
5792
5919
|
}
|
|
5793
5920
|
}
|
|
5794
5921
|
while (++index < length) {
|
|
5795
|
-
|
|
5796
|
-
var key =
|
|
5797
|
-
if (noCustomizer &&
|
|
5922
|
+
data = matchData[index];
|
|
5923
|
+
var key = data[0], objValue = object[key], srcValue = data[1];
|
|
5924
|
+
if (noCustomizer && data[2]) {
|
|
5798
5925
|
if (objValue === undefined$12 && !(key in object)) {
|
|
5799
5926
|
return false;
|
|
5800
5927
|
}
|
|
@@ -6097,8 +6224,8 @@ var lodash = { exports: {} };
|
|
|
6097
6224
|
}
|
|
6098
6225
|
return object;
|
|
6099
6226
|
}
|
|
6100
|
-
var baseSetData = !metaMap ? identity : function(func,
|
|
6101
|
-
metaMap.set(func,
|
|
6227
|
+
var baseSetData = !metaMap ? identity : function(func, data) {
|
|
6228
|
+
metaMap.set(func, data);
|
|
6102
6229
|
return func;
|
|
6103
6230
|
};
|
|
6104
6231
|
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
|
@@ -6602,9 +6729,9 @@ var lodash = { exports: {} };
|
|
|
6602
6729
|
index = wrapper ? index : length;
|
|
6603
6730
|
while (++index < length) {
|
|
6604
6731
|
func = funcs[index];
|
|
6605
|
-
var funcName = getFuncName(func),
|
|
6606
|
-
if (
|
|
6607
|
-
wrapper = wrapper[getFuncName(
|
|
6732
|
+
var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$12;
|
|
6733
|
+
if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
|
|
6734
|
+
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
|
|
6608
6735
|
} else {
|
|
6609
6736
|
wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
|
|
6610
6737
|
}
|
|
@@ -6831,7 +6958,7 @@ var lodash = { exports: {} };
|
|
|
6831
6958
|
var partialsRight = partials, holdersRight = holders;
|
|
6832
6959
|
partials = holders = undefined$12;
|
|
6833
6960
|
}
|
|
6834
|
-
var
|
|
6961
|
+
var data = isBindKey ? undefined$12 : getData(func);
|
|
6835
6962
|
var newData = [
|
|
6836
6963
|
func,
|
|
6837
6964
|
bitmask,
|
|
@@ -6844,8 +6971,8 @@ var lodash = { exports: {} };
|
|
|
6844
6971
|
ary2,
|
|
6845
6972
|
arity
|
|
6846
6973
|
];
|
|
6847
|
-
if (
|
|
6848
|
-
mergeData(newData,
|
|
6974
|
+
if (data) {
|
|
6975
|
+
mergeData(newData, data);
|
|
6849
6976
|
}
|
|
6850
6977
|
func = newData[0];
|
|
6851
6978
|
bitmask = newData[1];
|
|
@@ -6865,7 +6992,7 @@ var lodash = { exports: {} };
|
|
|
6865
6992
|
} else {
|
|
6866
6993
|
result2 = createHybrid.apply(undefined$12, newData);
|
|
6867
6994
|
}
|
|
6868
|
-
var setter =
|
|
6995
|
+
var setter = data ? baseSetData : setData;
|
|
6869
6996
|
return setWrapToString(setter(result2, newData), func, bitmask);
|
|
6870
6997
|
}
|
|
6871
6998
|
function customDefaultsAssignIn(objValue, srcValue, key, object) {
|
|
@@ -7032,9 +7159,9 @@ var lodash = { exports: {} };
|
|
|
7032
7159
|
function getFuncName(func) {
|
|
7033
7160
|
var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty2.call(realNames, result2) ? array.length : 0;
|
|
7034
7161
|
while (length--) {
|
|
7035
|
-
var
|
|
7162
|
+
var data = array[length], otherFunc = data.func;
|
|
7036
7163
|
if (otherFunc == null || otherFunc == func) {
|
|
7037
|
-
return
|
|
7164
|
+
return data.name;
|
|
7038
7165
|
}
|
|
7039
7166
|
}
|
|
7040
7167
|
return result2;
|
|
@@ -7049,8 +7176,8 @@ var lodash = { exports: {} };
|
|
|
7049
7176
|
return arguments.length ? result2(arguments[0], arguments[1]) : result2;
|
|
7050
7177
|
}
|
|
7051
7178
|
function getMapData(map2, key) {
|
|
7052
|
-
var
|
|
7053
|
-
return isKeyable(key) ?
|
|
7179
|
+
var data = map2.__data__;
|
|
7180
|
+
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
7054
7181
|
}
|
|
7055
7182
|
function getMatchData(object) {
|
|
7056
7183
|
var result2 = keys(object), length = result2.length;
|
|
@@ -7122,8 +7249,8 @@ var lodash = { exports: {} };
|
|
|
7122
7249
|
function getView(start, end, transforms) {
|
|
7123
7250
|
var index = -1, length = transforms.length;
|
|
7124
7251
|
while (++index < length) {
|
|
7125
|
-
var
|
|
7126
|
-
switch (
|
|
7252
|
+
var data = transforms[index], size2 = data.size;
|
|
7253
|
+
switch (data.type) {
|
|
7127
7254
|
case "drop":
|
|
7128
7255
|
start += size2;
|
|
7129
7256
|
break;
|
|
@@ -7254,8 +7381,8 @@ var lodash = { exports: {} };
|
|
|
7254
7381
|
if (func === other) {
|
|
7255
7382
|
return true;
|
|
7256
7383
|
}
|
|
7257
|
-
var
|
|
7258
|
-
return !!
|
|
7384
|
+
var data = getData(other);
|
|
7385
|
+
return !!data && func === data[0];
|
|
7259
7386
|
}
|
|
7260
7387
|
function isMasked(func) {
|
|
7261
7388
|
return !!maskSrcKey && maskSrcKey in func;
|
|
@@ -7286,41 +7413,41 @@ var lodash = { exports: {} };
|
|
|
7286
7413
|
var cache = result2.cache;
|
|
7287
7414
|
return result2;
|
|
7288
7415
|
}
|
|
7289
|
-
function mergeData(
|
|
7290
|
-
var bitmask =
|
|
7291
|
-
var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG &&
|
|
7416
|
+
function mergeData(data, source2) {
|
|
7417
|
+
var bitmask = data[1], srcBitmask = source2[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
|
|
7418
|
+
var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source2[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source2[7].length <= source2[8] && bitmask == WRAP_CURRY_FLAG;
|
|
7292
7419
|
if (!(isCommon || isCombo)) {
|
|
7293
|
-
return
|
|
7420
|
+
return data;
|
|
7294
7421
|
}
|
|
7295
7422
|
if (srcBitmask & WRAP_BIND_FLAG) {
|
|
7296
|
-
|
|
7423
|
+
data[2] = source2[2];
|
|
7297
7424
|
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
|
|
7298
7425
|
}
|
|
7299
7426
|
var value = source2[3];
|
|
7300
7427
|
if (value) {
|
|
7301
|
-
var partials =
|
|
7302
|
-
|
|
7303
|
-
|
|
7428
|
+
var partials = data[3];
|
|
7429
|
+
data[3] = partials ? composeArgs(partials, value, source2[4]) : value;
|
|
7430
|
+
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source2[4];
|
|
7304
7431
|
}
|
|
7305
7432
|
value = source2[5];
|
|
7306
7433
|
if (value) {
|
|
7307
|
-
partials =
|
|
7308
|
-
|
|
7309
|
-
|
|
7434
|
+
partials = data[5];
|
|
7435
|
+
data[5] = partials ? composeArgsRight(partials, value, source2[6]) : value;
|
|
7436
|
+
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source2[6];
|
|
7310
7437
|
}
|
|
7311
7438
|
value = source2[7];
|
|
7312
7439
|
if (value) {
|
|
7313
|
-
|
|
7440
|
+
data[7] = value;
|
|
7314
7441
|
}
|
|
7315
7442
|
if (srcBitmask & WRAP_ARY_FLAG) {
|
|
7316
|
-
|
|
7443
|
+
data[8] = data[8] == null ? source2[8] : nativeMin(data[8], source2[8]);
|
|
7317
7444
|
}
|
|
7318
|
-
if (
|
|
7319
|
-
|
|
7445
|
+
if (data[9] == null) {
|
|
7446
|
+
data[9] = source2[9];
|
|
7320
7447
|
}
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
return
|
|
7448
|
+
data[0] = source2[0];
|
|
7449
|
+
data[1] = newBitmask;
|
|
7450
|
+
return data;
|
|
7324
7451
|
}
|
|
7325
7452
|
function nativeKeysIn(object) {
|
|
7326
7453
|
var result2 = [];
|
|
@@ -8586,7 +8713,7 @@ var lodash = { exports: {} };
|
|
|
8586
8713
|
copyObject(source2, keys(source2), object, customizer);
|
|
8587
8714
|
});
|
|
8588
8715
|
var at = flatRest(baseAt);
|
|
8589
|
-
function
|
|
8716
|
+
function create2(prototype, properties) {
|
|
8590
8717
|
var result2 = baseCreate(prototype);
|
|
8591
8718
|
return properties == null ? result2 : baseAssign(result2, properties);
|
|
8592
8719
|
}
|
|
@@ -8937,22 +9064,22 @@ var lodash = { exports: {} };
|
|
|
8937
9064
|
var snakeCase = createCompounder(function(result2, word, index) {
|
|
8938
9065
|
return result2 + (index ? "_" : "") + word.toLowerCase();
|
|
8939
9066
|
});
|
|
8940
|
-
function split(string, separator,
|
|
8941
|
-
if (
|
|
8942
|
-
separator =
|
|
9067
|
+
function split(string, separator, limit2) {
|
|
9068
|
+
if (limit2 && typeof limit2 != "number" && isIterateeCall(string, separator, limit2)) {
|
|
9069
|
+
separator = limit2 = undefined$12;
|
|
8943
9070
|
}
|
|
8944
|
-
|
|
8945
|
-
if (!
|
|
9071
|
+
limit2 = limit2 === undefined$12 ? MAX_ARRAY_LENGTH : limit2 >>> 0;
|
|
9072
|
+
if (!limit2) {
|
|
8946
9073
|
return [];
|
|
8947
9074
|
}
|
|
8948
9075
|
string = toString3(string);
|
|
8949
9076
|
if (string && (typeof separator == "string" || separator != null && !isRegExp3(separator))) {
|
|
8950
9077
|
separator = baseToString(separator);
|
|
8951
9078
|
if (!separator && hasUnicode(string)) {
|
|
8952
|
-
return castSlice(stringToArray(string), 0,
|
|
9079
|
+
return castSlice(stringToArray(string), 0, limit2);
|
|
8953
9080
|
}
|
|
8954
9081
|
}
|
|
8955
|
-
return string.split(separator,
|
|
9082
|
+
return string.split(separator, limit2);
|
|
8956
9083
|
}
|
|
8957
9084
|
var startCase = createCompounder(function(result2, word, index) {
|
|
8958
9085
|
return result2 + (index ? " " : "") + upperFirst(word);
|
|
@@ -9333,7 +9460,7 @@ var lodash = { exports: {} };
|
|
|
9333
9460
|
lodash2.conforms = conforms;
|
|
9334
9461
|
lodash2.constant = constant;
|
|
9335
9462
|
lodash2.countBy = countBy;
|
|
9336
|
-
lodash2.create =
|
|
9463
|
+
lodash2.create = create2;
|
|
9337
9464
|
lodash2.curry = curry;
|
|
9338
9465
|
lodash2.curryRight = curryRight;
|
|
9339
9466
|
lodash2.debounce = debounce;
|
|
@@ -9628,7 +9755,7 @@ var lodash = { exports: {} };
|
|
|
9628
9755
|
});
|
|
9629
9756
|
return source2;
|
|
9630
9757
|
}(), { "chain": false });
|
|
9631
|
-
lodash2.VERSION =
|
|
9758
|
+
lodash2.VERSION = VERSION;
|
|
9632
9759
|
arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
|
|
9633
9760
|
lodash2[methodName].placeholder = lodash2;
|
|
9634
9761
|
});
|
|
@@ -9878,6 +10005,202 @@ function renderFieldEnums(fieldList = [], enumRelation = {}) {
|
|
|
9878
10005
|
});
|
|
9879
10006
|
return rlt;
|
|
9880
10007
|
}
|
|
10008
|
+
function isHb$2() {
|
|
10009
|
+
return window.location.pathname.includes("scyxweb");
|
|
10010
|
+
}
|
|
10011
|
+
const CONTEXT$5 = config.ossServerContext;
|
|
10012
|
+
function getOssFileUrl(fileId = "") {
|
|
10013
|
+
return `${isHb$2() ? "/scyxgateway/ind-uc-ext-server" : CONTEXT$5}/oss/file/get/${fileId}`;
|
|
10014
|
+
}
|
|
10015
|
+
function putOssFileUrl() {
|
|
10016
|
+
return `${isHb$2() ? "/scyxgateway/ind-uc-ext-server" : CONTEXT$5}/oss/file/put`;
|
|
10017
|
+
}
|
|
10018
|
+
function getOssFileApi(fileId, responseType) {
|
|
10019
|
+
const config2 = {};
|
|
10020
|
+
if (responseType) {
|
|
10021
|
+
config2.responseType = responseType;
|
|
10022
|
+
}
|
|
10023
|
+
return instance.get(getOssFileUrl(fileId), config2);
|
|
10024
|
+
}
|
|
10025
|
+
function putOssFileApi(filename, blob) {
|
|
10026
|
+
let formData = new FormData();
|
|
10027
|
+
formData.append("file", blob, filename);
|
|
10028
|
+
return instance({
|
|
10029
|
+
method: "post",
|
|
10030
|
+
url: putOssFileUrl(),
|
|
10031
|
+
headers: { "Content-Type": CONTENT_TYPE.multiForm },
|
|
10032
|
+
data: formData
|
|
10033
|
+
});
|
|
10034
|
+
}
|
|
10035
|
+
function getPreviewUrlApi(fileId) {
|
|
10036
|
+
const isWeb = location.protocol === "https:" ? "1" : "";
|
|
10037
|
+
const axiosConfig = {};
|
|
10038
|
+
return instance.get(
|
|
10039
|
+
`${config.ucExtServerContext}/api/wps/getPreviewUrl/${fileId}?isWeb=${isWeb}&previewMode=high_definition`,
|
|
10040
|
+
axiosConfig
|
|
10041
|
+
);
|
|
10042
|
+
}
|
|
10043
|
+
function downLoadScDcApi(fileId, fileName) {
|
|
10044
|
+
return __async(this, null, function* () {
|
|
10045
|
+
const ua = navigator.userAgent;
|
|
10046
|
+
if (/miniProgram/i.test(ua)) {
|
|
10047
|
+
window.wx.miniProgram.navigateTo({
|
|
10048
|
+
url: `/pages/download/index?downloadFileId=${fileId}`
|
|
10049
|
+
});
|
|
10050
|
+
} else {
|
|
10051
|
+
const downloadUrl = `${(isHb$2() ? "/scyxgateway" : "") + "/ind-uc-ext-server"}/oss/file/get/${fileId}`;
|
|
10052
|
+
const token = getToken();
|
|
10053
|
+
const response = yield fetch(downloadUrl, {
|
|
10054
|
+
headers: {
|
|
10055
|
+
token: token + ""
|
|
10056
|
+
}
|
|
10057
|
+
});
|
|
10058
|
+
if (!response.ok) {
|
|
10059
|
+
throw new Error(`\u4E0B\u8F7D\u5931\u8D25: ${response.status}`);
|
|
10060
|
+
}
|
|
10061
|
+
const blob = yield response.blob();
|
|
10062
|
+
if (!fileName) {
|
|
10063
|
+
fileName = getFilenameFromResponse(response);
|
|
10064
|
+
}
|
|
10065
|
+
let mimeType = "application/octet-stream";
|
|
10066
|
+
const name2 = fileName == null ? void 0 : fileName.toLowerCase();
|
|
10067
|
+
const match = name2.match(/\.([a-z0-9]+)$/);
|
|
10068
|
+
const extension = match == null ? void 0 : match[1];
|
|
10069
|
+
if (MIME_TYPE[extension]) {
|
|
10070
|
+
mimeType = MIME_TYPE[extension];
|
|
10071
|
+
}
|
|
10072
|
+
const fileBlob = new Blob([blob], { type: mimeType });
|
|
10073
|
+
const url = window.URL.createObjectURL(fileBlob);
|
|
10074
|
+
const link = document.createElement("a");
|
|
10075
|
+
link.href = url;
|
|
10076
|
+
link.download = fileName;
|
|
10077
|
+
link.style.display = "none";
|
|
10078
|
+
link.target = "_blank";
|
|
10079
|
+
document.body.appendChild(link);
|
|
10080
|
+
link.click();
|
|
10081
|
+
document.body.removeChild(link);
|
|
10082
|
+
}
|
|
10083
|
+
});
|
|
10084
|
+
}
|
|
10085
|
+
function parseContentDisposition(contentDisposition) {
|
|
10086
|
+
if (!contentDisposition)
|
|
10087
|
+
return null;
|
|
10088
|
+
console.log("\u539F\u59CB Content-Disposition:", contentDisposition);
|
|
10089
|
+
const utf8FilenameMatch = contentDisposition.match(/filename\*=(?:UTF-8''|UTF-8\s*'')([^;]+)/i);
|
|
10090
|
+
if (utf8FilenameMatch && utf8FilenameMatch[1]) {
|
|
10091
|
+
try {
|
|
10092
|
+
const decoded = decodeURIComponent(utf8FilenameMatch[1].trim());
|
|
10093
|
+
console.log("\u89E3\u6790 RFC 5987 \u6587\u4EF6\u540D:", decoded);
|
|
10094
|
+
return decoded;
|
|
10095
|
+
} catch (e) {
|
|
10096
|
+
console.warn("RFC 5987 \u89E3\u7801\u5931\u8D25:", e);
|
|
10097
|
+
}
|
|
10098
|
+
}
|
|
10099
|
+
const filenameStarMatch = contentDisposition.match(/filename\*=([^;]+)/i);
|
|
10100
|
+
if (filenameStarMatch && filenameStarMatch[1]) {
|
|
10101
|
+
const encoded = filenameStarMatch[1].trim();
|
|
10102
|
+
if (encoded.includes("''")) {
|
|
10103
|
+
const parts = encoded.split("''");
|
|
10104
|
+
if (parts.length === 2) {
|
|
10105
|
+
try {
|
|
10106
|
+
const decoded = decodeURIComponent(parts[1]);
|
|
10107
|
+
console.log("\u89E3\u6790 filename* \u6587\u4EF6\u540D:", decoded);
|
|
10108
|
+
return decoded;
|
|
10109
|
+
} catch (e) {
|
|
10110
|
+
console.warn("filename* \u89E3\u7801\u5931\u8D25:", e);
|
|
10111
|
+
}
|
|
10112
|
+
}
|
|
10113
|
+
}
|
|
10114
|
+
}
|
|
10115
|
+
const quotedFilenameMatch = contentDisposition.match(/filename="([^"]+)"/i);
|
|
10116
|
+
if (quotedFilenameMatch && quotedFilenameMatch[1]) {
|
|
10117
|
+
console.log("\u89E3\u6790\u5F15\u53F7\u5185\u6587\u4EF6\u540D:", quotedFilenameMatch[1]);
|
|
10118
|
+
return quotedFilenameMatch[1];
|
|
10119
|
+
}
|
|
10120
|
+
const unquotedFilenameMatch = contentDisposition.match(/filename=([^;]+)/i);
|
|
10121
|
+
if (unquotedFilenameMatch && unquotedFilenameMatch[1]) {
|
|
10122
|
+
const filename = unquotedFilenameMatch[1].trim();
|
|
10123
|
+
console.log("\u89E3\u6790\u65E0\u5F15\u53F7\u6587\u4EF6\u540D:", filename);
|
|
10124
|
+
return filename;
|
|
10125
|
+
}
|
|
10126
|
+
console.log("\u672A\u627E\u5230\u6709\u6548\u7684\u6587\u4EF6\u540D");
|
|
10127
|
+
return null;
|
|
10128
|
+
}
|
|
10129
|
+
function getFilenameFromResponse(response) {
|
|
10130
|
+
const contentDisposition = response.headers.get("Content-Disposition");
|
|
10131
|
+
console.log("Content-Disposition \u5934:", contentDisposition);
|
|
10132
|
+
let filename = null;
|
|
10133
|
+
if (contentDisposition) {
|
|
10134
|
+
filename = parseContentDisposition(contentDisposition);
|
|
10135
|
+
console.log("\u89E3\u6790\u5230\u7684\u6587\u4EF6\u540D:", filename);
|
|
10136
|
+
}
|
|
10137
|
+
if (!filename && response.url) {
|
|
10138
|
+
filename = extractFilenameFromUrl(response.url);
|
|
10139
|
+
console.log("\u4ECE URL \u63D0\u53D6\u7684\u6587\u4EF6\u540D:", filename);
|
|
10140
|
+
}
|
|
10141
|
+
if (!filename) {
|
|
10142
|
+
filename = "download";
|
|
10143
|
+
console.log("\u4F7F\u7528\u9ED8\u8BA4\u6587\u4EF6\u540D:", filename);
|
|
10144
|
+
}
|
|
10145
|
+
filename = ensureFileExtension(filename, response.headers.get("Content-Type"));
|
|
10146
|
+
return filename;
|
|
10147
|
+
}
|
|
10148
|
+
function getExtensionFromContentType(contentType) {
|
|
10149
|
+
if (!contentType)
|
|
10150
|
+
return "";
|
|
10151
|
+
const contentTypeToExtension = {
|
|
10152
|
+
"image/jpeg": ".jpg",
|
|
10153
|
+
"image/jpg": ".jpg",
|
|
10154
|
+
"image/png": ".png",
|
|
10155
|
+
"image/gif": ".gif",
|
|
10156
|
+
"image/webp": ".webp",
|
|
10157
|
+
"image/svg+xml": ".svg",
|
|
10158
|
+
"image/bmp": ".bmp",
|
|
10159
|
+
"application/pdf": ".pdf",
|
|
10160
|
+
"application/msword": ".doc",
|
|
10161
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
|
|
10162
|
+
"application/vnd.ms-excel": ".xls",
|
|
10163
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
|
|
10164
|
+
"application/vnd.ms-powerpoint": ".ppt",
|
|
10165
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx",
|
|
10166
|
+
"text/plain": ".txt",
|
|
10167
|
+
"text/html": ".html",
|
|
10168
|
+
"text/css": ".css",
|
|
10169
|
+
"text/javascript": ".js",
|
|
10170
|
+
"application/json": ".json",
|
|
10171
|
+
"text/csv": ".csv",
|
|
10172
|
+
"text/xml": ".xml",
|
|
10173
|
+
"application/zip": ".zip",
|
|
10174
|
+
"application/x-rar-compressed": ".rar",
|
|
10175
|
+
"application/x-7z-compressed": ".7z",
|
|
10176
|
+
"application/gzip": ".gz",
|
|
10177
|
+
"application/octet-stream": ".bin"
|
|
10178
|
+
};
|
|
10179
|
+
const mainType = contentType.split(";")[0].trim();
|
|
10180
|
+
return contentTypeToExtension[mainType] || "";
|
|
10181
|
+
}
|
|
10182
|
+
function ensureFileExtension(filename, contentType) {
|
|
10183
|
+
if (filename.includes(".")) {
|
|
10184
|
+
return filename;
|
|
10185
|
+
}
|
|
10186
|
+
const extension = getExtensionFromContentType(contentType);
|
|
10187
|
+
if (extension) {
|
|
10188
|
+
return filename + extension;
|
|
10189
|
+
}
|
|
10190
|
+
return filename;
|
|
10191
|
+
}
|
|
10192
|
+
function extractFilenameFromUrl(url) {
|
|
10193
|
+
try {
|
|
10194
|
+
const urlObj = new URL(url);
|
|
10195
|
+
const pathname = urlObj.pathname;
|
|
10196
|
+
const lastSegment = pathname.split("/").pop();
|
|
10197
|
+
const filename = lastSegment.split("?")[0].split("#")[0];
|
|
10198
|
+
return filename || null;
|
|
10199
|
+
} catch (e) {
|
|
10200
|
+
console.warn("\u4ECE URL \u63D0\u53D6\u6587\u4EF6\u540D\u5931\u8D25:", e);
|
|
10201
|
+
return null;
|
|
10202
|
+
}
|
|
10203
|
+
}
|
|
9881
10204
|
const titleStyle = {
|
|
9882
10205
|
bold: true,
|
|
9883
10206
|
fontSize: "14",
|
|
@@ -10275,7 +10598,6 @@ function importJsonFromExcel(excelData) {
|
|
|
10275
10598
|
return new Promise((resolve, reject) => {
|
|
10276
10599
|
var calcExportDatas = getAgColumnTitleAndData(excelData);
|
|
10277
10600
|
var titleDeepth = calcExportDatas.deepth;
|
|
10278
|
-
calcExportDatas.exportData;
|
|
10279
10601
|
const reader = new FileReader();
|
|
10280
10602
|
reader.onload = (event) => __async(this, null, function* () {
|
|
10281
10603
|
XlsxPopulate.fromDataAsync(event.target.result).then((workbook) => {
|
|
@@ -10346,6 +10668,131 @@ function getExcelColumnIdx(number) {
|
|
|
10346
10668
|
}
|
|
10347
10669
|
return rlt;
|
|
10348
10670
|
}
|
|
10671
|
+
function previewJsonToExcel(excelData) {
|
|
10672
|
+
return new Promise((resolve, reject) => {
|
|
10673
|
+
var calcExportDatas = getAgColumnTitleAndData(excelData);
|
|
10674
|
+
var fileId = "";
|
|
10675
|
+
console.log("calcExportDatas", calcExportDatas);
|
|
10676
|
+
var title = excelData.title;
|
|
10677
|
+
var titleDeepth = calcExportDatas.deepth;
|
|
10678
|
+
var columnAlign = excelData.columnAlign || calcExportDatas.columnAlign;
|
|
10679
|
+
var columnType = excelData.columnType || calcExportDatas.columnType;
|
|
10680
|
+
var columnTitle = calcExportDatas.columnTitle;
|
|
10681
|
+
var columnWidth = excelData.columnWidth || calcExportDatas.columnWidth;
|
|
10682
|
+
var columnCount = columnAlign.length;
|
|
10683
|
+
var paramLeft = excelData.paramLeft;
|
|
10684
|
+
var paramRight = excelData.paramRight;
|
|
10685
|
+
var jsonData = calcExportDatas.exportData;
|
|
10686
|
+
var numberFormat = excelData.numberFormat || calcExportDatas.numberFormat;
|
|
10687
|
+
XlsxPopulate.fromBlankAsync().then((workbook) => {
|
|
10688
|
+
var sheet = workbook.sheet("Sheet1");
|
|
10689
|
+
for (var i = 0; i < columnCount; i++) {
|
|
10690
|
+
sheet.column(i + 1).width(columnWidth[i] == 0 ? 10 : columnWidth[i]);
|
|
10691
|
+
}
|
|
10692
|
+
var titleRange = sheet.range(1, 1, 1, columnCount);
|
|
10693
|
+
titleRange.merged(true);
|
|
10694
|
+
titleRange.style(titleStyle);
|
|
10695
|
+
titleRange.cell(0, 0).value(title);
|
|
10696
|
+
sheet.row(1).height(titleHeight);
|
|
10697
|
+
var rowsNow = 2;
|
|
10698
|
+
if (!!excelData.paramLeft || !!excelData.paramRight) {
|
|
10699
|
+
var paramLeftRange = sheet.range(2, 1, 2, Math.round(columnCount / 2));
|
|
10700
|
+
paramLeftRange.cell(0, 0).value(paramLeft || "");
|
|
10701
|
+
paramLeftRange.merged(true);
|
|
10702
|
+
paramLeftRange.style(paramLeftStyle);
|
|
10703
|
+
var paramRightRange = sheet.range(2, Math.round(columnCount / 2) + 1, 2, columnCount);
|
|
10704
|
+
paramRightRange.cell(0, 0).value(paramRight || "");
|
|
10705
|
+
paramRightRange.merged(true);
|
|
10706
|
+
paramRightRange.style(paramRightStyle);
|
|
10707
|
+
sheet.row(2).height(paramHeight);
|
|
10708
|
+
rowsNow += 1;
|
|
10709
|
+
}
|
|
10710
|
+
columnTitle.forEach((d) => {
|
|
10711
|
+
var _a;
|
|
10712
|
+
var columnTitleRange = sheet.range(
|
|
10713
|
+
d.srow + rowsNow - 1,
|
|
10714
|
+
d.scol,
|
|
10715
|
+
d.erow + rowsNow - 1,
|
|
10716
|
+
d.ecol
|
|
10717
|
+
);
|
|
10718
|
+
columnTitleRange.merged(true);
|
|
10719
|
+
columnTitleRange.style(columnTitleStyle);
|
|
10720
|
+
columnTitleRange.cell(0, 0).value((_a = d.text) == null ? void 0 : _a.replace(/<br\/>/g, ""));
|
|
10721
|
+
});
|
|
10722
|
+
for (let i2 = 0; i2 < titleDeepth; i2++) {
|
|
10723
|
+
sheet.row(rowsNow + i2).height(columnTitleHeight);
|
|
10724
|
+
}
|
|
10725
|
+
rowsNow += titleDeepth;
|
|
10726
|
+
for (var i = 0; i < jsonData.length; i++) {
|
|
10727
|
+
var lineData = jsonData[i];
|
|
10728
|
+
for (var j = 0; j < lineData.length; j++) {
|
|
10729
|
+
if (columnType[j] === "p" && lineData[j]) {
|
|
10730
|
+
sheet.cell(rowsNow + i, j + 1).value(parseFloat(lineData[j].value / 100));
|
|
10731
|
+
dataCellStyle.numberFormat = numberFormat[j];
|
|
10732
|
+
} else if (columnType[j] === "n" && lineData[j]) {
|
|
10733
|
+
sheet.cell(rowsNow + i, j + 1).value(parseFloat(lineData[j].value));
|
|
10734
|
+
dataCellStyle.numberFormat = numberFormat[j];
|
|
10735
|
+
} else if (columnType[j] === "s" && lineData[j]) {
|
|
10736
|
+
sheet.cell(rowsNow + i, j + 1).value(lineData[j].value);
|
|
10737
|
+
dataCellStyle.numberFormat = "";
|
|
10738
|
+
} else {
|
|
10739
|
+
if (columnType[j] === "p" || columnType[j] === "n") {
|
|
10740
|
+
dataCellStyle.numberFormat = numberFormat[j];
|
|
10741
|
+
} else {
|
|
10742
|
+
sheet.cell(rowsNow + i, j + 1).value("");
|
|
10743
|
+
}
|
|
10744
|
+
}
|
|
10745
|
+
dataCellStyle.horizontalAlignment = columnAlign[j];
|
|
10746
|
+
sheet.cell(rowsNow + i, j + 1).style(dataCellStyle);
|
|
10747
|
+
}
|
|
10748
|
+
if (excelData.rowColor && i % 2 != 0) {
|
|
10749
|
+
var row = sheet.range(rowsNow + i, 1, rowsNow + i, columnCount);
|
|
10750
|
+
row.style({ fill: "f8f8f9" });
|
|
10751
|
+
}
|
|
10752
|
+
sheet.row(rowsNow + i).height(dataRowHeight);
|
|
10753
|
+
}
|
|
10754
|
+
if (!!excelData.rowSpanDefs) {
|
|
10755
|
+
initRowSpanInfosNew(__spreadProps(__spreadValues({}, excelData), { columns: calcExportDatas.columnsCalc }));
|
|
10756
|
+
_.forEach(rowSpanExcelInfos, function(rowSpanInfo) {
|
|
10757
|
+
var columnTitleRange = sheet.range(
|
|
10758
|
+
rowSpanInfo.mergeRowS + rowsNow,
|
|
10759
|
+
rowSpanInfo.megerColS + 1,
|
|
10760
|
+
rowSpanInfo.mergeRowE + rowsNow,
|
|
10761
|
+
rowSpanInfo.megerColE + 1
|
|
10762
|
+
);
|
|
10763
|
+
columnTitleRange.merged(true);
|
|
10764
|
+
});
|
|
10765
|
+
} else if (!!excelData.rowSpanColumns) {
|
|
10766
|
+
initRowSpanInfos(__spreadProps(__spreadValues({}, excelData), { columns: calcExportDatas.columnsCalc }));
|
|
10767
|
+
_.forEach(rowSpanExcelInfos, function(rowSpanInfo) {
|
|
10768
|
+
var columnTitleRange = sheet.range(
|
|
10769
|
+
rowSpanInfo.mergeRowS + rowsNow,
|
|
10770
|
+
rowSpanInfo.megerColS + 1,
|
|
10771
|
+
rowSpanInfo.mergeRowE + rowsNow,
|
|
10772
|
+
rowSpanInfo.megerColE + 1
|
|
10773
|
+
);
|
|
10774
|
+
columnTitleRange.merged(true);
|
|
10775
|
+
});
|
|
10776
|
+
}
|
|
10777
|
+
if (excelData.leftColumns || excelData.topRows) {
|
|
10778
|
+
sheet.freezePanes(excelData.leftColumns || 0, (excelData.topRows || 0) + rowsNow - 1);
|
|
10779
|
+
}
|
|
10780
|
+
workbook.outputAsync().then(function(blob) {
|
|
10781
|
+
return __async(this, null, function* () {
|
|
10782
|
+
const timestamp = new Date().getTime();
|
|
10783
|
+
const filename = `${timestamp}.xlsx`;
|
|
10784
|
+
let { data } = yield putOssFileApi(filename, blob);
|
|
10785
|
+
console.log("data is --111111", data);
|
|
10786
|
+
fileId = (data == null ? void 0 : data[0].fileId) || "";
|
|
10787
|
+
resolve(fileId);
|
|
10788
|
+
});
|
|
10789
|
+
});
|
|
10790
|
+
}).catch((err) => {
|
|
10791
|
+
console.log(err);
|
|
10792
|
+
reject(err);
|
|
10793
|
+
});
|
|
10794
|
+
});
|
|
10795
|
+
}
|
|
10349
10796
|
function onFn() {
|
|
10350
10797
|
if (document.addEventListener) {
|
|
10351
10798
|
return function(element, event, handler) {
|
|
@@ -10696,7 +11143,7 @@ function renderHeaderTooltip({
|
|
|
10696
11143
|
}
|
|
10697
11144
|
return text;
|
|
10698
11145
|
}
|
|
10699
|
-
function renderColumnTree(
|
|
11146
|
+
function renderColumnTree(data, columnGroup, option = {}) {
|
|
10700
11147
|
var _b;
|
|
10701
11148
|
const _a = columnGroup, {
|
|
10702
11149
|
key,
|
|
@@ -10725,7 +11172,7 @@ function renderColumnTree(data2, columnGroup, option = {}) {
|
|
|
10725
11172
|
]);
|
|
10726
11173
|
const { keyPropName = "key", titlePropName = "title", keyPrefix = "", parents = [] } = option;
|
|
10727
11174
|
if (keyProp) {
|
|
10728
|
-
let columnUniqData = ((_b = _.uniqBy(
|
|
11175
|
+
let columnUniqData = ((_b = _.uniqBy(data, columnGroup.keyProp)) == null ? void 0 : _b.filter((item) => !isNil(item[columnGroup.keyProp]))) || [];
|
|
10729
11176
|
if (sortProp) {
|
|
10730
11177
|
const unSortData = columnUniqData.filter((item) => isNil(item[sortProp]));
|
|
10731
11178
|
const sortData = columnUniqData.filter((item) => !isNil(item[sortProp]));
|
|
@@ -10736,7 +11183,7 @@ function renderColumnTree(data2, columnGroup, option = {}) {
|
|
|
10736
11183
|
if (children && children.length) {
|
|
10737
11184
|
const prefix = `${keyPrefix}${keyProp}${VALUE_SEP}${item[keyProp]}${GROUP_SEP}`;
|
|
10738
11185
|
const columnChildren = children.map((child) => {
|
|
10739
|
-
let nextData = isLimitChildren ?
|
|
11186
|
+
let nextData = isLimitChildren ? data.filter((temp) => temp[keyProp] === item[keyProp]) : data;
|
|
10740
11187
|
return renderColumnTree(nextData, child, __spreadProps(__spreadValues({}, option), {
|
|
10741
11188
|
keyPrefix: prefix,
|
|
10742
11189
|
parents: [...parents, item]
|
|
@@ -10775,7 +11222,7 @@ function renderColumnTree(data2, columnGroup, option = {}) {
|
|
|
10775
11222
|
if (children && children.length) {
|
|
10776
11223
|
const prefix = `${keyPrefix}${key || ""}`;
|
|
10777
11224
|
const columnChildren = children.map((child) => {
|
|
10778
|
-
return renderColumnTree(
|
|
11225
|
+
return renderColumnTree(data, child, __spreadProps(__spreadValues({}, option), { keyPrefix: prefix }));
|
|
10779
11226
|
});
|
|
10780
11227
|
return __spreadProps(__spreadValues({}, args), {
|
|
10781
11228
|
[titlePropName]: title,
|
|
@@ -10800,7 +11247,7 @@ function getLeafColumns(columns = []) {
|
|
|
10800
11247
|
}
|
|
10801
11248
|
}, []);
|
|
10802
11249
|
}
|
|
10803
|
-
function renderRowData(
|
|
11250
|
+
function renderRowData(data, keys) {
|
|
10804
11251
|
var _a;
|
|
10805
11252
|
if (!keys.length)
|
|
10806
11253
|
return;
|
|
@@ -10808,13 +11255,13 @@ function renderRowData(data2, keys) {
|
|
|
10808
11255
|
keys = keys.slice(1);
|
|
10809
11256
|
if (key.includes(VALUE_SEP) && keys.length) {
|
|
10810
11257
|
const [keyProp, keyValue] = key.split(VALUE_SEP);
|
|
10811
|
-
const matchData = _.filter(
|
|
11258
|
+
const matchData = _.filter(data, { [keyProp]: keyValue });
|
|
10812
11259
|
return renderRowData(matchData, keys);
|
|
10813
11260
|
}
|
|
10814
11261
|
if (keys.length) {
|
|
10815
11262
|
console.error("\u600E\u4E48\u4F1A\u4E0D\u662F\u6700\u540E\u4E00\u5C42\u5206\u7EC4\u5462\uFF0C\u8BF7\u8054\u7CFB\u5F00\u53D1\u4EBA\u5458\u67E5\u770B\uFF01");
|
|
10816
11263
|
}
|
|
10817
|
-
const value = (_a =
|
|
11264
|
+
const value = (_a = data == null ? void 0 : data[0]) == null ? void 0 : _a[key];
|
|
10818
11265
|
return value;
|
|
10819
11266
|
}
|
|
10820
11267
|
function getRowKeyValue(item, rowKey) {
|
|
@@ -10854,19 +11301,19 @@ function renderSumColumns({ sumColumnDefs }) {
|
|
|
10854
11301
|
}
|
|
10855
11302
|
return columns;
|
|
10856
11303
|
}
|
|
10857
|
-
function row2column(
|
|
11304
|
+
function row2column(data = [], columnGroups = [], rowKey, option = {}) {
|
|
10858
11305
|
var _a;
|
|
10859
11306
|
const columns = [];
|
|
10860
11307
|
if (option.sumColumnDefs && option.sumColumnDefs.length) {
|
|
10861
11308
|
columns.push(...renderSumColumns(option));
|
|
10862
11309
|
}
|
|
10863
|
-
const groupColumns = _.flatten(columnGroups.map((group) => renderColumnTree(
|
|
11310
|
+
const groupColumns = _.flatten(columnGroups.map((group) => renderColumnTree(data, group, option))) || [];
|
|
10864
11311
|
columns.push(...groupColumns);
|
|
10865
11312
|
const leafColumns = getLeafColumns(columns);
|
|
10866
|
-
const rowKeyUniqData = ((_a = _.uniqBy(
|
|
11313
|
+
const rowKeyUniqData = ((_a = _.uniqBy(data, (item) => getRowKeyValue(item, rowKey))) == null ? void 0 : _a.filter(
|
|
10867
11314
|
(item) => !isNil(getRowKeyValue(item, rowKey))
|
|
10868
11315
|
)) || [];
|
|
10869
|
-
const groupData = _.groupBy(
|
|
11316
|
+
const groupData = _.groupBy(data, (item) => getRowKeyValue(item, rowKey));
|
|
10870
11317
|
const rltData = rowKeyUniqData.map((item) => {
|
|
10871
11318
|
const rowKeyValue = getRowKeyValue(item, rowKey);
|
|
10872
11319
|
const rowGroupData = groupData[rowKeyValue] || [];
|
|
@@ -10926,9 +11373,9 @@ function flattenRowData(rowData = {}, leafColumns = [], option = {}) {
|
|
|
10926
11373
|
});
|
|
10927
11374
|
return rlt;
|
|
10928
11375
|
}
|
|
10929
|
-
function flattenRow2ColumnData(
|
|
11376
|
+
function flattenRow2ColumnData(data = [], columns = [], option = {}) {
|
|
10930
11377
|
const leafColumns = getLeafColumns(columns);
|
|
10931
|
-
return
|
|
11378
|
+
return data.reduce(
|
|
10932
11379
|
(rlt, rowData) => [...rlt, ...flattenRowData(rowData, leafColumns, option)],
|
|
10933
11380
|
[]
|
|
10934
11381
|
);
|
|
@@ -11072,12 +11519,12 @@ const DICT_KEY = "ind-dict_";
|
|
|
11072
11519
|
function getDictCache(dictId) {
|
|
11073
11520
|
return getSessionStorage(`${DICT_KEY}${dictId}`);
|
|
11074
11521
|
}
|
|
11075
|
-
function setDictCache(dictId,
|
|
11076
|
-
setSessionStorage(`${DICT_KEY}${dictId}`,
|
|
11522
|
+
function setDictCache(dictId, data) {
|
|
11523
|
+
setSessionStorage(`${DICT_KEY}${dictId}`, data);
|
|
11077
11524
|
}
|
|
11078
|
-
const CONTEXT$
|
|
11525
|
+
const CONTEXT$4 = config.authServerContext;
|
|
11079
11526
|
function getDictsMapApi(dictId) {
|
|
11080
|
-
return instance.get(`${CONTEXT$
|
|
11527
|
+
return instance.get(`${CONTEXT$4}/anon/dict/getDictsMap`, { params: { dictId } });
|
|
11081
11528
|
}
|
|
11082
11529
|
function getDictApi(dictId) {
|
|
11083
11530
|
return __async(this, null, function* () {
|
|
@@ -11089,9 +11536,9 @@ function getDictApi(dictId) {
|
|
|
11089
11536
|
return dictValue;
|
|
11090
11537
|
}
|
|
11091
11538
|
try {
|
|
11092
|
-
const { data
|
|
11093
|
-
setDictCache(dictId,
|
|
11094
|
-
return
|
|
11539
|
+
const { data } = yield instance.get(`${CONTEXT$4}/dict/getDicts`, { params: { dictId } });
|
|
11540
|
+
setDictCache(dictId, data);
|
|
11541
|
+
return data;
|
|
11095
11542
|
} catch (error) {
|
|
11096
11543
|
console.error(`getDict error dictId=${dictId}`, error);
|
|
11097
11544
|
}
|
|
@@ -11113,229 +11560,36 @@ function getDictMapApi(dictIdArr) {
|
|
|
11113
11560
|
return resultMap;
|
|
11114
11561
|
});
|
|
11115
11562
|
}
|
|
11116
|
-
const CONTEXT$
|
|
11563
|
+
const CONTEXT$3 = config.authServerContext;
|
|
11117
11564
|
function getPermissionApi() {
|
|
11118
|
-
return instance.get(`${CONTEXT$
|
|
11565
|
+
return instance.get(`${CONTEXT$3}/manage/menu/getAllPermission`);
|
|
11119
11566
|
}
|
|
11120
11567
|
function getMenuHistoryApi() {
|
|
11121
|
-
return instance.get(`${CONTEXT$
|
|
11568
|
+
return instance.get(`${CONTEXT$3}/manage/upmsMenuHistory/list`);
|
|
11122
11569
|
}
|
|
11123
11570
|
function menuHistoryApi(params) {
|
|
11124
|
-
return instance.post(`${CONTEXT$
|
|
11571
|
+
return instance.post(`${CONTEXT$3}/manage/upmsMenuHistory/add`, null, { params });
|
|
11125
11572
|
}
|
|
11126
11573
|
function deleteMenuHistoryApi(historyId) {
|
|
11127
|
-
return instance.get(`${CONTEXT$
|
|
11574
|
+
return instance.get(`${CONTEXT$3}/manage/upmsMenuHistory/delete/` + historyId);
|
|
11128
11575
|
}
|
|
11129
11576
|
function getMenuCollectApi() {
|
|
11130
|
-
return instance.get(`${CONTEXT$
|
|
11577
|
+
return instance.get(`${CONTEXT$3}/manage/upmsMenuCollect/list`);
|
|
11131
11578
|
}
|
|
11132
11579
|
function addMenuCollectApi(params) {
|
|
11133
|
-
return instance.post(`${CONTEXT$
|
|
11580
|
+
return instance.post(`${CONTEXT$3}/manage/upmsMenuCollect/add`, null, { params });
|
|
11134
11581
|
}
|
|
11135
11582
|
function deleteMenuCollectApi(collectId) {
|
|
11136
|
-
return instance.get(`${CONTEXT$
|
|
11583
|
+
return instance.get(`${CONTEXT$3}/manage/upmsMenuCollect/delete/` + collectId);
|
|
11137
11584
|
}
|
|
11138
11585
|
function removeMenuCollectApi(params) {
|
|
11139
|
-
return instance.post(`${CONTEXT$
|
|
11586
|
+
return instance.post(`${CONTEXT$3}/manage/upmsMenuCollect/remove`, null, { params });
|
|
11140
11587
|
}
|
|
11141
11588
|
function getAppListApi() {
|
|
11142
|
-
return instance.get(`${CONTEXT$
|
|
11589
|
+
return instance.get(`${CONTEXT$3}/manage/app/list`);
|
|
11143
11590
|
}
|
|
11144
11591
|
function getMaxTabNumValueApi() {
|
|
11145
|
-
return instance.get(`${CONTEXT$
|
|
11146
|
-
}
|
|
11147
|
-
const CONTEXT$3 = config.ossServerContext;
|
|
11148
|
-
function getOssFileUrl(fileId = "") {
|
|
11149
|
-
return `${CONTEXT$3}/oss/file/get/${fileId}`;
|
|
11150
|
-
}
|
|
11151
|
-
function putOssFileUrl() {
|
|
11152
|
-
return `${CONTEXT$3}/oss/file/put`;
|
|
11153
|
-
}
|
|
11154
|
-
function getOssFileApi(fileId, responseType) {
|
|
11155
|
-
const config2 = {};
|
|
11156
|
-
if (responseType) {
|
|
11157
|
-
config2.responseType = responseType;
|
|
11158
|
-
}
|
|
11159
|
-
return instance.get(getOssFileUrl(fileId), config2);
|
|
11160
|
-
}
|
|
11161
|
-
function putOssFileApi(filename, blob) {
|
|
11162
|
-
let formData = new FormData();
|
|
11163
|
-
formData.append("file", blob, filename);
|
|
11164
|
-
return instance({
|
|
11165
|
-
method: "post",
|
|
11166
|
-
url: putOssFileUrl(),
|
|
11167
|
-
headers: { "Content-Type": CONTENT_TYPE.multiForm },
|
|
11168
|
-
data: formData
|
|
11169
|
-
});
|
|
11170
|
-
}
|
|
11171
|
-
function getPreviewUrlApi(fileId) {
|
|
11172
|
-
const isWeb = location.protocol === "https:" ? "1" : "";
|
|
11173
|
-
const axiosConfig = {};
|
|
11174
|
-
return instance.get(
|
|
11175
|
-
`${config.ucExtServerContext}/api/wps/getPreviewUrl/${fileId}?isWeb=${isWeb}&previewMode=high_definition`,
|
|
11176
|
-
axiosConfig
|
|
11177
|
-
);
|
|
11178
|
-
}
|
|
11179
|
-
function downLoadScDcApi(fileId, fileName) {
|
|
11180
|
-
return __async(this, null, function* () {
|
|
11181
|
-
const ua = navigator.userAgent;
|
|
11182
|
-
if (/miniProgram/i.test(ua)) {
|
|
11183
|
-
window.wx.miniProgram.navigateTo({
|
|
11184
|
-
url: `/pages/download/index?downloadFileId=${fileId}`
|
|
11185
|
-
});
|
|
11186
|
-
} else {
|
|
11187
|
-
const downloadUrl = `${(location.pathname.includes("scyxweb") ? "/scyxgateway" : "") + "/ind-uc-ext-server"}/oss/file/get/${fileId}`;
|
|
11188
|
-
const token = getToken();
|
|
11189
|
-
const response = yield fetch(downloadUrl, {
|
|
11190
|
-
headers: {
|
|
11191
|
-
token: token + ""
|
|
11192
|
-
}
|
|
11193
|
-
});
|
|
11194
|
-
if (!response.ok) {
|
|
11195
|
-
throw new Error(`\u4E0B\u8F7D\u5931\u8D25: ${response.status}`);
|
|
11196
|
-
}
|
|
11197
|
-
const blob = yield response.blob();
|
|
11198
|
-
if (!fileName) {
|
|
11199
|
-
fileName = getFilenameFromResponse(response);
|
|
11200
|
-
}
|
|
11201
|
-
let mimeType = "application/octet-stream";
|
|
11202
|
-
const name = fileName == null ? void 0 : fileName.toLowerCase();
|
|
11203
|
-
const match = name.match(/\.([a-z0-9]+)$/);
|
|
11204
|
-
const extension = match == null ? void 0 : match[1];
|
|
11205
|
-
if (MIME_TYPE[extension]) {
|
|
11206
|
-
mimeType = MIME_TYPE[extension];
|
|
11207
|
-
}
|
|
11208
|
-
const fileBlob = new Blob([blob], { type: mimeType });
|
|
11209
|
-
const url = window.URL.createObjectURL(fileBlob);
|
|
11210
|
-
const link = document.createElement("a");
|
|
11211
|
-
link.href = url;
|
|
11212
|
-
link.download = fileName;
|
|
11213
|
-
link.style.display = "none";
|
|
11214
|
-
link.target = "_blank";
|
|
11215
|
-
document.body.appendChild(link);
|
|
11216
|
-
link.click();
|
|
11217
|
-
document.body.removeChild(link);
|
|
11218
|
-
}
|
|
11219
|
-
});
|
|
11220
|
-
}
|
|
11221
|
-
function parseContentDisposition(contentDisposition) {
|
|
11222
|
-
if (!contentDisposition)
|
|
11223
|
-
return null;
|
|
11224
|
-
console.log("\u539F\u59CB Content-Disposition:", contentDisposition);
|
|
11225
|
-
const utf8FilenameMatch = contentDisposition.match(/filename\*=(?:UTF-8''|UTF-8\s*'')([^;]+)/i);
|
|
11226
|
-
if (utf8FilenameMatch && utf8FilenameMatch[1]) {
|
|
11227
|
-
try {
|
|
11228
|
-
const decoded = decodeURIComponent(utf8FilenameMatch[1].trim());
|
|
11229
|
-
console.log("\u89E3\u6790 RFC 5987 \u6587\u4EF6\u540D:", decoded);
|
|
11230
|
-
return decoded;
|
|
11231
|
-
} catch (e) {
|
|
11232
|
-
console.warn("RFC 5987 \u89E3\u7801\u5931\u8D25:", e);
|
|
11233
|
-
}
|
|
11234
|
-
}
|
|
11235
|
-
const filenameStarMatch = contentDisposition.match(/filename\*=([^;]+)/i);
|
|
11236
|
-
if (filenameStarMatch && filenameStarMatch[1]) {
|
|
11237
|
-
const encoded = filenameStarMatch[1].trim();
|
|
11238
|
-
if (encoded.includes("''")) {
|
|
11239
|
-
const parts = encoded.split("''");
|
|
11240
|
-
if (parts.length === 2) {
|
|
11241
|
-
try {
|
|
11242
|
-
const decoded = decodeURIComponent(parts[1]);
|
|
11243
|
-
console.log("\u89E3\u6790 filename* \u6587\u4EF6\u540D:", decoded);
|
|
11244
|
-
return decoded;
|
|
11245
|
-
} catch (e) {
|
|
11246
|
-
console.warn("filename* \u89E3\u7801\u5931\u8D25:", e);
|
|
11247
|
-
}
|
|
11248
|
-
}
|
|
11249
|
-
}
|
|
11250
|
-
}
|
|
11251
|
-
const quotedFilenameMatch = contentDisposition.match(/filename="([^"]+)"/i);
|
|
11252
|
-
if (quotedFilenameMatch && quotedFilenameMatch[1]) {
|
|
11253
|
-
console.log("\u89E3\u6790\u5F15\u53F7\u5185\u6587\u4EF6\u540D:", quotedFilenameMatch[1]);
|
|
11254
|
-
return quotedFilenameMatch[1];
|
|
11255
|
-
}
|
|
11256
|
-
const unquotedFilenameMatch = contentDisposition.match(/filename=([^;]+)/i);
|
|
11257
|
-
if (unquotedFilenameMatch && unquotedFilenameMatch[1]) {
|
|
11258
|
-
const filename = unquotedFilenameMatch[1].trim();
|
|
11259
|
-
console.log("\u89E3\u6790\u65E0\u5F15\u53F7\u6587\u4EF6\u540D:", filename);
|
|
11260
|
-
return filename;
|
|
11261
|
-
}
|
|
11262
|
-
console.log("\u672A\u627E\u5230\u6709\u6548\u7684\u6587\u4EF6\u540D");
|
|
11263
|
-
return null;
|
|
11264
|
-
}
|
|
11265
|
-
function getFilenameFromResponse(response) {
|
|
11266
|
-
const contentDisposition = response.headers.get("Content-Disposition");
|
|
11267
|
-
console.log("Content-Disposition \u5934:", contentDisposition);
|
|
11268
|
-
let filename = null;
|
|
11269
|
-
if (contentDisposition) {
|
|
11270
|
-
filename = parseContentDisposition(contentDisposition);
|
|
11271
|
-
console.log("\u89E3\u6790\u5230\u7684\u6587\u4EF6\u540D:", filename);
|
|
11272
|
-
}
|
|
11273
|
-
if (!filename && response.url) {
|
|
11274
|
-
filename = extractFilenameFromUrl(response.url);
|
|
11275
|
-
console.log("\u4ECE URL \u63D0\u53D6\u7684\u6587\u4EF6\u540D:", filename);
|
|
11276
|
-
}
|
|
11277
|
-
if (!filename) {
|
|
11278
|
-
filename = "download";
|
|
11279
|
-
console.log("\u4F7F\u7528\u9ED8\u8BA4\u6587\u4EF6\u540D:", filename);
|
|
11280
|
-
}
|
|
11281
|
-
filename = ensureFileExtension(filename, response.headers.get("Content-Type"));
|
|
11282
|
-
return filename;
|
|
11283
|
-
}
|
|
11284
|
-
function getExtensionFromContentType(contentType) {
|
|
11285
|
-
if (!contentType)
|
|
11286
|
-
return "";
|
|
11287
|
-
const contentTypeToExtension = {
|
|
11288
|
-
"image/jpeg": ".jpg",
|
|
11289
|
-
"image/jpg": ".jpg",
|
|
11290
|
-
"image/png": ".png",
|
|
11291
|
-
"image/gif": ".gif",
|
|
11292
|
-
"image/webp": ".webp",
|
|
11293
|
-
"image/svg+xml": ".svg",
|
|
11294
|
-
"image/bmp": ".bmp",
|
|
11295
|
-
"application/pdf": ".pdf",
|
|
11296
|
-
"application/msword": ".doc",
|
|
11297
|
-
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx",
|
|
11298
|
-
"application/vnd.ms-excel": ".xls",
|
|
11299
|
-
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx",
|
|
11300
|
-
"application/vnd.ms-powerpoint": ".ppt",
|
|
11301
|
-
"application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx",
|
|
11302
|
-
"text/plain": ".txt",
|
|
11303
|
-
"text/html": ".html",
|
|
11304
|
-
"text/css": ".css",
|
|
11305
|
-
"text/javascript": ".js",
|
|
11306
|
-
"application/json": ".json",
|
|
11307
|
-
"text/csv": ".csv",
|
|
11308
|
-
"text/xml": ".xml",
|
|
11309
|
-
"application/zip": ".zip",
|
|
11310
|
-
"application/x-rar-compressed": ".rar",
|
|
11311
|
-
"application/x-7z-compressed": ".7z",
|
|
11312
|
-
"application/gzip": ".gz",
|
|
11313
|
-
"application/octet-stream": ".bin"
|
|
11314
|
-
};
|
|
11315
|
-
const mainType = contentType.split(";")[0].trim();
|
|
11316
|
-
return contentTypeToExtension[mainType] || "";
|
|
11317
|
-
}
|
|
11318
|
-
function ensureFileExtension(filename, contentType) {
|
|
11319
|
-
if (filename.includes(".")) {
|
|
11320
|
-
return filename;
|
|
11321
|
-
}
|
|
11322
|
-
const extension = getExtensionFromContentType(contentType);
|
|
11323
|
-
if (extension) {
|
|
11324
|
-
return filename + extension;
|
|
11325
|
-
}
|
|
11326
|
-
return filename;
|
|
11327
|
-
}
|
|
11328
|
-
function extractFilenameFromUrl(url) {
|
|
11329
|
-
try {
|
|
11330
|
-
const urlObj = new URL(url);
|
|
11331
|
-
const pathname = urlObj.pathname;
|
|
11332
|
-
const lastSegment = pathname.split("/").pop();
|
|
11333
|
-
const filename = lastSegment.split("?")[0].split("#")[0];
|
|
11334
|
-
return filename || null;
|
|
11335
|
-
} catch (e) {
|
|
11336
|
-
console.warn("\u4ECE URL \u63D0\u53D6\u6587\u4EF6\u540D\u5931\u8D25:", e);
|
|
11337
|
-
return null;
|
|
11338
|
-
}
|
|
11592
|
+
return instance.get(`${CONTEXT$3}/ipm/bc/basic/item/getMaxTabNum`);
|
|
11339
11593
|
}
|
|
11340
11594
|
let Base64 = {
|
|
11341
11595
|
Base64Chars: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@*-",
|
|
@@ -11429,8 +11683,8 @@ function loginApi({ userName, password, validCodeId, validCodeInput }) {
|
|
|
11429
11683
|
let nodeRSA = new window.NodeRSA(publicKey, "pkcs8-public");
|
|
11430
11684
|
let rsaPaswword = nodeRSA.encrypt(password, "base64");
|
|
11431
11685
|
let upw = Base64.encode(rsaPaswword);
|
|
11432
|
-
const
|
|
11433
|
-
return instance.formPost(CONTEXT$2 + "/sso/auth/login",
|
|
11686
|
+
const data = { usn: userName, upw, validCodeId, validCodeInput };
|
|
11687
|
+
return instance.formPost(CONTEXT$2 + "/sso/auth/login", data);
|
|
11434
11688
|
}
|
|
11435
11689
|
function getUserInfoApi() {
|
|
11436
11690
|
return instance.get(`${CONTEXT$2}/manage/user/getCurrentInfo`);
|
|
@@ -11438,8 +11692,8 @@ function getUserInfoApi() {
|
|
|
11438
11692
|
function getGlobalPolicyApi() {
|
|
11439
11693
|
return instance.get(`${CONTEXT$2}/anon/user/getGlobalPolicy`);
|
|
11440
11694
|
}
|
|
11441
|
-
function updatePasswordApi(
|
|
11442
|
-
return instance.post(`${CONTEXT$2}/manage/user/updatePassword`,
|
|
11695
|
+
function updatePasswordApi(data) {
|
|
11696
|
+
return instance.post(`${CONTEXT$2}/manage/user/updatePassword`, data);
|
|
11443
11697
|
}
|
|
11444
11698
|
function getCaptchaURL(validCodeId) {
|
|
11445
11699
|
return `${CONTEXT$2}/anon/user/getCaptcha/` + validCodeId;
|
|
@@ -11453,18 +11707,20 @@ const getGlobalConfig = () => __async(void 0, null, function* () {
|
|
|
11453
11707
|
return getSessionStorage(GLOBAL_CACHE_KEY);
|
|
11454
11708
|
} else {
|
|
11455
11709
|
let url = location.protocol + "//" + location.host + "/ibp-sc/manage/global?t=" + new Date().getTime();
|
|
11456
|
-
return axios.get(url).then(({ data
|
|
11457
|
-
setSessionStorage(GLOBAL_CACHE_KEY,
|
|
11458
|
-
return
|
|
11710
|
+
return axios.get(url).then(({ data }) => {
|
|
11711
|
+
setSessionStorage(GLOBAL_CACHE_KEY, data);
|
|
11712
|
+
return data;
|
|
11459
11713
|
});
|
|
11460
11714
|
}
|
|
11461
11715
|
});
|
|
11462
|
-
|
|
11716
|
+
function isHb$1() {
|
|
11717
|
+
return window.location.pathname.includes("scyxweb");
|
|
11718
|
+
}
|
|
11463
11719
|
const CONTEXT$1 = config.ismAmServerContext;
|
|
11464
11720
|
function listComTreeApi(params) {
|
|
11465
11721
|
if (config.useDddComItemTree) {
|
|
11466
11722
|
return instance.get(
|
|
11467
|
-
`${isHb$1 ? "/scyxgateway" : ""}${config.ucExtServerContext}/manage/tree/getBusiComTree`,
|
|
11723
|
+
`${isHb$1() ? "/scyxgateway" : ""}${config.ucExtServerContext}/manage/tree/getBusiComTree`,
|
|
11468
11724
|
{ params }
|
|
11469
11725
|
);
|
|
11470
11726
|
}
|
|
@@ -11474,12 +11730,14 @@ const UC_CONTEXT$2 = config.ucExtServerContext;
|
|
|
11474
11730
|
function listIndexDescApi(params) {
|
|
11475
11731
|
return instance.get(`${UC_CONTEXT$2}/index-desc/list`, { params });
|
|
11476
11732
|
}
|
|
11477
|
-
|
|
11733
|
+
function isHb() {
|
|
11734
|
+
return window.location.pathname.includes("scyxweb");
|
|
11735
|
+
}
|
|
11478
11736
|
const CONTEXT = config.ismAmServerContext;
|
|
11479
11737
|
function listItemTreeApi(params) {
|
|
11480
11738
|
if (config.useDddComItemTree) {
|
|
11481
11739
|
return instance.get(
|
|
11482
|
-
`${isHb ? "/scyxgateway" : ""}${config.ucExtServerContext}/manage/tree/getProductInfoAsTreeData`,
|
|
11740
|
+
`${isHb() ? "/scyxgateway" : ""}${config.ucExtServerContext}/manage/tree/getProductInfoAsTreeData`,
|
|
11483
11741
|
{
|
|
11484
11742
|
params
|
|
11485
11743
|
}
|
|
@@ -11543,4 +11801,4 @@ function listUserTreeApi(params) {
|
|
|
11543
11801
|
return (_b = getLocalStorage(DATAVERSION_KEY)) == null ? void 0 : _b.response;
|
|
11544
11802
|
});
|
|
11545
11803
|
}
|
|
11546
|
-
export { Base64ForLogin, CONTENT_TYPE, IS_OR_NOT_ENUM, IS_OR_NOT_ENUM_KEY, IS_OR_NOT_ENUM_LIST, MIME_TYPE, UC_ENUM, addMenuCollectApi, instance as axios, base64ToBlob, blobToBase64, checkIdCard, checkPhone, checkTel, checkVehicleNo, clearIndexDescCache, clearPermissionCache, clearSessionStorage, clearUserInfoCache, config, cryptor, deleteMenuCollectApi, deleteMenuHistoryApi, downLoadScDcApi, exportJsonToExcel, flattenRow2ColumnData, formatDate, formatDateChinese, formatDecimal, formatHalfYear, formatQuarter, getAppListApi, getApplicationTreeApi, getCaptchaURL, getContentType, getDictApi, getDictMapApi, getDictsMapApi, getExcelColumnIdx, getGlobalConfig, getGlobalPolicyApi, getHalfYear, getHalfYearBeginMonth, getHalfYearEndMonth, getHalfYearNum, getIndexDescCache, getItem, getLocalStorage, getMaxTabNumValueApi, getMenuCollectApi, getMenuHistoryApi, getOssFileApi, getOssFileUrl, getPermissionApi, getPermissionCache, getPreviewUrlApi, getPriceInfo, getQuarter, getQuarterBeginMonth, getQuarterEndMonth, getQuarterNum, getSessionStorage, getToken, getType, getUrlParams, getUserInfoApi, getUserInfoCache, guid, importJsonFromExcel, isArguments, isArray, isArrayLike, isBoolean, isDate, isDecimal, isElement, isEmpty, isEqual, isEqualWith, isError, isEven, isFinite$1 as isFinite, isFunction, isInteger, isNegative, isNil, isNull, isNumber, isNumberEqual, isObject, isObjectLike, isOdd, isPlainObject, isPositive, isPromise, isPrototype, isRegExp2 as isRegExp, isString, isType, isUndefined, listComTreeApi, listIndexDescApi, listItemTreeApi, listUserTreeApi, loginApi, logoutApi, menuHistoryApi, numToChineseNumerals, numToDX, off, on, preventDefault, putOssFileApi, putOssFileUrl, quarter2Chinese, removeLocalStorage, removeMenuCollectApi, removeSessionStorage, renderColumnEnums, renderEnumData, renderEnumList, renderFieldEnums, responseInterceptors, round, row2column, setConfig, setContentType, setIndexDescCache, setLocalStorage, setPermissionCache, setSessionStorage, setToken, setUserInfoCache, stopPropagation, str2Date, toChies, toFixed, toThousands, updatePasswordApi, useConfig, uuid, wrapApi };
|
|
11804
|
+
export { Base64ForLogin, CONTENT_TYPE, IS_OR_NOT_ENUM, IS_OR_NOT_ENUM_KEY, IS_OR_NOT_ENUM_LIST, MIME_TYPE, UC_ENUM, addMenuCollectApi, instance as axios, base64ToBlob, blobToBase64, checkIdCard, checkPhone, checkTel, checkVehicleNo, clearIndexDescCache, clearPermissionCache, clearSessionStorage, clearUserInfoCache, config, cryptor, deleteMenuCollectApi, deleteMenuHistoryApi, downLoadScDcApi, exportJsonToExcel, flattenRow2ColumnData, formatDate, formatDateChinese, formatDecimal, formatHalfYear, formatQuarter, getAppListApi, getApplicationTreeApi, getCaptchaURL, getContentType, getDictApi, getDictMapApi, getDictsMapApi, getExcelColumnIdx, getGlobalConfig, getGlobalPolicyApi, getHalfYear, getHalfYearBeginMonth, getHalfYearEndMonth, getHalfYearNum, getIndexDescCache, getItem, getLocalStorage, getMaxTabNumValueApi, getMenuCollectApi, getMenuHistoryApi, getOssFileApi, getOssFileUrl, getPermissionApi, getPermissionCache, getPreviewUrlApi, getPriceInfo, getQuarter, getQuarterBeginMonth, getQuarterEndMonth, getQuarterNum, getSessionStorage, getToken, getType, getUrlParams, getUserInfoApi, getUserInfoCache, guid, importJsonFromExcel, isArguments, isArray, isArrayLike, isBoolean, isDate, isDecimal, isElement, isEmpty, isEqual, isEqualWith, isError, isEven, isFinite$1 as isFinite, isFunction, isInteger, isNegative, isNil, isNull, isNumber, isNumberEqual, isObject, isObjectLike, isOdd, isPlainObject, isPositive, isPromise, isPrototype, isRegExp2 as isRegExp, isString, isType, isUndefined, listComTreeApi, listIndexDescApi, listItemTreeApi, listUserTreeApi, loginApi, logoutApi, menuHistoryApi, numToChineseNumerals, numToDX, off, on, preventDefault, previewJsonToExcel, putOssFileApi, putOssFileUrl, quarter2Chinese, removeLocalStorage, removeMenuCollectApi, removeSessionStorage, renderColumnEnums, renderEnumData, renderEnumList, renderFieldEnums, responseInterceptors, round, row2column, setConfig, setContentType, setIndexDescCache, setLocalStorage, setPermissionCache, setSessionStorage, setToken, setUserInfoCache, stopPropagation, str2Date, toChies, toFixed, toThousands, updatePasswordApi, useConfig, uuid, wrapApi };
|