@bchr/bchr-front-lib 0.5.1-alpha-20241221 → 0.5.2

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.
@@ -9,8 +9,6 @@ var _lodash = _interopRequireDefault(require("lodash"));
9
9
 
10
10
  var _LangTypes = _interopRequireDefault(require("./LangTypes"));
11
11
 
12
- var _IllegalArgumentError = _interopRequireDefault(require("../error/IllegalArgumentError"));
13
-
14
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
13
 
16
14
  var isWhitespace = function isWhitespace(c) {
@@ -59,7 +57,7 @@ var Strings = {
59
57
  }
60
58
 
61
59
  if (!_lodash["default"].isString(value)) {
62
- throw new _IllegalArgumentError["default"]("Invalid value [" + value + "] for Strings#removeBlankStrings");
60
+ throw new Error("Invalid value [" + value + "] for Strings#removeBlankStrings");
63
61
  }
64
62
 
65
63
  var lastString = "";
@@ -11,14 +11,8 @@ var _queryString = _interopRequireDefault(require("query-string"));
11
11
 
12
12
  var _utils = require("../base/utils");
13
13
 
14
- var _fileSaver = require("file-saver");
15
-
16
- var _AppKits = require("../base/utils/AppKits");
17
-
18
14
  var _antd = require("antd");
19
15
 
20
- var _react = _interopRequireDefault(require("react"));
21
-
22
16
  var _this = void 0;
23
17
 
24
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -486,616 +480,6 @@ var http = {
486
480
  } else if (_this.isInView("main_view2")) {
487
481
  _this.redirectTo("main_view", parameterObject);
488
482
  }
489
- },
490
- post: function post(options, jsonObject, mockData) {
491
- var ajaxOptions = {};
492
- var failedDealFunction = this.dealAjaxException;
493
-
494
- if (_lodash["default"].isPlainObject(options)) {
495
- if (_lodash["default"].isFunction(options.fail)) {
496
- failedDealFunction = options.fail;
497
- delete options.fail;
498
- }
499
-
500
- ajaxOptions = _objectSpread({}, options);
501
- }
502
-
503
- try {
504
- this.__checkJSONObjectSecurity(jsonObject);
505
- } catch (e) {
506
- var promise = new Promise(function (resolve, reject) {
507
- return reject(e);
508
- });
509
-
510
- if (this.isUseDefaultExceptionHandler()) {
511
- return promise["catch"](failedDealFunction);
512
- }
513
-
514
- return promise;
515
- }
516
-
517
- if (jsonObject) {
518
- ajaxOptions.data = jsonObject;
519
- }
520
-
521
- if (ajaxOptions.rpcMethodName) {
522
- delete ajaxOptions.rpcMethodName;
523
- }
524
-
525
- ajaxOptions.type = "post";
526
- ajaxOptions.dataType = "json";
527
-
528
- if (!ajaxOptions.url) {
529
- ajaxOptions.url = this.getRequestPath(options);
530
- }
531
-
532
- if (this.isValidMockData(mockData)) {
533
- var _promise = this.__postForMock(mockData);
534
-
535
- if (this.isUseDefaultExceptionHandler()) {
536
- return _promise["catch"](failedDealFunction);
537
- }
538
-
539
- return _promise;
540
- } else {
541
- var deferred = window.$.ajax(ajaxOptions);
542
-
543
- if (this.isUseDefaultExceptionHandler()) {
544
- return this.__toStdPromise(deferred, failedDealFunction);
545
- } else {
546
- return this.__toStdPromise(deferred);
547
- }
548
- }
549
- },
550
- __postForMock: function __postForMock(mockData) {
551
- var waitTime = mockData.waitTime ? mockData.waitTime : 600;
552
- return new Promise(function (resolve, reject) {
553
- setTimeout(function () {
554
- if (mockData.success === false) {
555
- return reject(new Error(mockData.message ? mockData.message : "请求数据发生异常"));
556
- } else {
557
- var resultData = mockData.data ? mockData.data : mockData;
558
- return resolve(resultData);
559
- }
560
- }, waitTime);
561
- });
562
- },
563
- postJSONWithNotCareSecurity: function postJSONWithNotCareSecurity(options, jsonObject, mockData) {
564
- var ajaxOptions = {};
565
- var failedDealFunction = this.dealAjaxException;
566
-
567
- if (_lodash["default"].isPlainObject(options)) {
568
- if (_lodash["default"].isFunction(options.fail)) {
569
- failedDealFunction = options.fail;
570
- delete options.fail;
571
- }
572
-
573
- ajaxOptions = _objectSpread({}, options);
574
- }
575
-
576
- if (ajaxOptions.rpcMethodName) {
577
- delete ajaxOptions.rpcMethodName;
578
- }
579
-
580
- if (_lodash["default"].isPlainObject(ajaxOptions.data)) {
581
- jsonObject = ajaxOptions.data;
582
- }
583
-
584
- if (jsonObject) {
585
- ajaxOptions.data = jsonObject;
586
- }
587
-
588
- if (ajaxOptions.data) {
589
- ajaxOptions.data = JSON.stringify(ajaxOptions.data);
590
- }
591
-
592
- ajaxOptions.type = "post";
593
- ajaxOptions.dataType = "json";
594
- ajaxOptions.contentType = "application/json; charset=utf-8";
595
-
596
- if (!ajaxOptions.url) {
597
- ajaxOptions.url = this.getRequestPath(options);
598
- }
599
-
600
- if (this.isValidMockData(mockData)) {
601
- var promise = this.__postJSONForMock(mockData);
602
-
603
- if (this.isUseDefaultExceptionHandler()) {
604
- return promise["catch"](failedDealFunction);
605
- }
606
-
607
- return promise;
608
- } else {
609
- var deferred = window.$.ajax(ajaxOptions);
610
-
611
- if (this.isUseDefaultExceptionHandler()) {
612
- return this.__toStdPromise(deferred, failedDealFunction);
613
- } else {
614
- return this.__toStdPromise(deferred);
615
- }
616
- }
617
- },
618
- postJSON: function postJSON(options, jsonObject, mockData) {
619
- var ajaxOptions = {};
620
- var failedDealFunction = this.dealAjaxException;
621
-
622
- if (_lodash["default"].isPlainObject(options)) {
623
- if (_lodash["default"].isFunction(options.fail)) {
624
- failedDealFunction = options.fail;
625
- delete options.fail;
626
- }
627
-
628
- ajaxOptions = _objectSpread({}, options);
629
- }
630
-
631
- if (_lodash["default"].isPlainObject(ajaxOptions.data)) {
632
- jsonObject = ajaxOptions.data;
633
- }
634
-
635
- try {
636
- this.__checkJSONObjectSecurity(jsonObject);
637
- } catch (e) {
638
- var promise = new Promise(function (resolve, reject) {
639
- return reject(e);
640
- });
641
-
642
- if (this.isUseDefaultExceptionHandler()) {
643
- return promise["catch"](failedDealFunction);
644
- }
645
-
646
- return promise;
647
- }
648
-
649
- return this.postJSONWithNotCareSecurity(options, jsonObject, mockData);
650
- },
651
- postJSONAllowHTML: function postJSONAllowHTML(options, jsonObject, mockData) {
652
- var ajaxOptions = {};
653
- var failedDealFunction = this.dealAjaxException;
654
-
655
- if (_lodash["default"].isPlainObject(options)) {
656
- if (_lodash["default"].isFunction(options.fail)) {
657
- failedDealFunction = options.fail;
658
- delete options.fail;
659
- }
660
-
661
- ajaxOptions = _objectSpread({}, options);
662
- }
663
-
664
- if (_lodash["default"].isPlainObject(ajaxOptions.data)) {
665
- jsonObject = ajaxOptions.data;
666
- }
667
-
668
- try {
669
- this.__checkJSONObjectContainsScriptTag(jsonObject);
670
- } catch (e) {
671
- var promise = new Promise(function (resolve, reject) {
672
- return reject(e);
673
- });
674
-
675
- if (this.isUseDefaultExceptionHandler()) {
676
- return promise["catch"](failedDealFunction);
677
- }
678
-
679
- return promise;
680
- }
681
-
682
- return this.postJSONWithNotCareSecurity(options, jsonObject, mockData);
683
- },
684
- __checkJSONObjectContainsScriptTag: function __checkJSONObjectContainsScriptTag(jsonObject) {
685
- if (!jsonObject) {
686
- return;
687
- }
688
-
689
- if (_lodash["default"].isString(jsonObject)) {
690
- this.__checkStringContainsScriptTag(jsonObject);
691
- } else if (Array.isArray(jsonObject)) {
692
- var len = jsonObject.length;
693
-
694
- if (len === 0) {
695
- return;
696
- }
697
-
698
- for (var i = 0; i < len; i++) {
699
- this.__checkJSONObjectContainsScriptTag(jsonObject[i]);
700
- }
701
- } else if (_lodash["default"].isPlainObject(jsonObject)) {
702
- for (var p in jsonObject) {
703
- this.__checkJSONObjectContainsScriptTag(jsonObject[p]);
704
- }
705
- }
706
-
707
- return;
708
- },
709
- __checkStringContainsScriptTag: function __checkStringContainsScriptTag(str) {
710
- if (!str || str.length < 3) {
711
- return;
712
- }
713
-
714
- var containsHTML = /<(noframes|noscript|object|script|video).*?<\/\2>/i.test(str);
715
-
716
- if (containsHTML) {
717
- throw new Error("不安全的输入,请检查!");
718
- }
719
- },
720
- __checkJSONObjectSecurity: function __checkJSONObjectSecurity(jsonObject) {
721
- if (!jsonObject) {
722
- return;
723
- }
724
-
725
- if (_lodash["default"].isString(jsonObject)) {
726
- this.__checkStringIfSecurity(jsonObject);
727
- } else if (Array.isArray(jsonObject)) {
728
- var len = jsonObject.length;
729
-
730
- if (len === 0) {
731
- return;
732
- }
733
-
734
- for (var i = 0; i < len; i++) {
735
- this.__checkJSONObjectSecurity(jsonObject[i]);
736
- }
737
- } else if (_lodash["default"].isPlainObject(jsonObject)) {
738
- for (var p in jsonObject) {
739
- this.__checkJSONObjectSecurity(jsonObject[p]);
740
- }
741
- }
742
-
743
- return;
744
- },
745
- __checkStringIfSecurity: function __checkStringIfSecurity(str) {
746
- if (!str || str.length < 3) {
747
- return;
748
- }
749
-
750
- var containsHTML = /<(br|basefont|hr|input|source|frame|param|area|meta|!--|col|link|option|base|img|wbr|!DOCTYPE).*?>|<(a|abbr|acronym|address|applet|article|aside|audio|b|bdi|bdo|big|blockquote|body|button|canvas|caption|center|cite|code|colgroup|command|datalist|dd|del|details|dfn|dialog|dir|div|dl|dt|em|embed|fieldset|figcaption|figure|font|footer|form|frameset|head|header|hgroup|h1|h2|h3|h4|h5|h6|html|i|iframe|ins|kbd|keygen|label|legend|li|map|mark|menu|meter|nav|noframes|noscript|object|ol|optgroup|output|p|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video).*?<\/\2>/i.test(str);
751
-
752
- if (containsHTML) {
753
- throw new Error("不安全的输入,请检查!");
754
- }
755
- },
756
- __postJSONForMock: function __postJSONForMock(mockData) {
757
- var waitTime = mockData.waitTime ? mockData.waitTime : 300;
758
- return new Promise(function (resolve, reject) {
759
- setTimeout(function () {
760
- if (mockData.success === false) {
761
- return reject(new Error(mockData.message ? mockData.message : "请求数据发生异常"));
762
- } else {
763
- var resultData = mockData.data ? mockData.data : mockData;
764
- return resolve(resultData);
765
- }
766
- }, waitTime);
767
- });
768
- },
769
- getJSON: function getJSON(options, paramObject, mockData) {
770
- var ajaxOptions = {};
771
- var failedDealFunction = this.dealAjaxException;
772
-
773
- if (_lodash["default"].isPlainObject(options)) {
774
- if (_lodash["default"].isFunction(options.fail)) {
775
- failedDealFunction = options.fail;
776
- delete options.fail;
777
- }
778
-
779
- ajaxOptions = _objectSpread({}, options);
780
- }
781
-
782
- ajaxOptions.type = "get";
783
- ajaxOptions.dataType = "json";
784
-
785
- if (_lodash["default"].isPlainObject(paramObject)) {
786
- ajaxOptions.data = paramObject;
787
- }
788
-
789
- if (!ajaxOptions.data) {
790
- ajaxOptions.data = {};
791
- }
792
-
793
- if (!ajaxOptions.data.euts) {
794
- ajaxOptions.data.euts = new Date().getTime();
795
- }
796
-
797
- if (!ajaxOptions.url) {
798
- ajaxOptions.url = this.getRequestPath(options);
799
- }
800
-
801
- if (this.isValidMockData(mockData)) {
802
- var promise = this.__getJSONForMock(mockData);
803
-
804
- if (this.isUseDefaultExceptionHandler()) {
805
- return promise["catch"](failedDealFunction);
806
- }
807
-
808
- return promise;
809
- } else {
810
- var deferred = window.$.ajax(ajaxOptions);
811
-
812
- if (this.isUseDefaultExceptionHandler()) {
813
- return this.__toStdPromise(deferred, failedDealFunction);
814
- } else {
815
- return this.__toStdPromise(deferred);
816
- }
817
- }
818
- },
819
- isValidMockData: function isValidMockData(mockData) {
820
- if (mockData === null || mockData === void 0) {
821
- return false;
822
- }
823
-
824
- return _lodash["default"].isPlainObject(mockData);
825
- },
826
- __getJSONForMock: function __getJSONForMock(mockData) {
827
- var waitTime = mockData.waitTime ? mockData.waitTime : 600;
828
- return new Promise(function (resolve, reject) {
829
- setTimeout(function () {
830
- if (mockData.success === false) {
831
- return reject(new Error(mockData.message ? mockData.message : "请求数据发生异常"));
832
- } else {
833
- var resultData = mockData.data ? mockData.data : mockData;
834
- return resolve(resultData);
835
- }
836
- }, waitTime);
837
- });
838
- },
839
- requestStaticHTMLTemplate: function requestStaticHTMLTemplate(staticTemplateFilePath) {
840
- var deferred = window.$.ajax({
841
- url: staticTemplateFilePath,
842
- dataType: "html"
843
- });
844
- var failedDealFunction = this.dealAjaxException;
845
- return this.__toStdPromise(deferred, failedDealFunction);
846
- },
847
- downloadFileByPostJSON: function downloadFileByPostJSON(options, jsonObject, saveFileName) {
848
- var ajaxOptions = {};
849
- var failedDealFunction = this.dealAjaxException;
850
-
851
- if (_lodash["default"].isPlainObject(options)) {
852
- if (_lodash["default"].isFunction(options.fail)) {
853
- failedDealFunction = options.fail;
854
- delete options.fail;
855
- }
856
-
857
- ajaxOptions = _objectSpread({}, options);
858
- }
859
-
860
- if (_lodash["default"].isPlainObject(ajaxOptions.data)) {
861
- jsonObject = ajaxOptions.data;
862
- }
863
-
864
- try {
865
- this.__checkJSONObjectSecurity(jsonObject);
866
- } catch (e) {
867
- var promise = new Promise(function (resolve, reject) {
868
- return reject(e);
869
- });
870
-
871
- if (this.isUseDefaultExceptionHandler()) {
872
- return promise["catch"](failedDealFunction);
873
- }
874
-
875
- return promise;
876
- }
877
-
878
- if (jsonObject) {
879
- ajaxOptions.data = jsonObject;
880
- }
881
-
882
- if (ajaxOptions.rpcMethodName) {
883
- delete ajaxOptions.rpcMethodName;
884
- }
885
-
886
- ajaxOptions.type = "post";
887
- ajaxOptions.dataType = "*";
888
-
889
- if (!ajaxOptions.data) {
890
- ajaxOptions.data = {};
891
- }
892
-
893
- if (!ajaxOptions.data.euts) {
894
- ajaxOptions.data.euts = new Date().getTime();
895
- }
896
-
897
- if (!ajaxOptions.url) {
898
- ajaxOptions.url = this.getRequestPath(options);
899
- }
900
-
901
- ajaxOptions.xhrFields = {
902
- responseType: "blob"
903
- };
904
-
905
- ajaxOptions.success = function (result, request, xhr) {
906
- var fileName = "下载文件-" + new Date().getTime();
907
-
908
- if (_lodash["default"].isString(saveFileName) && saveFileName.length > 0) {
909
- fileName = saveFileName;
910
- } else {
911
- var contentDisposition = xhr.getResponseHeader('Content-Disposition');
912
-
913
- if (contentDisposition && contentDisposition.split) {
914
- var parts = contentDisposition.split(';');
915
-
916
- if (parts.length >= 1) {
917
- var fileInfo = parts[1];
918
- var fileInfoArray = fileInfo.split('=');
919
-
920
- if (fileInfoArray.length >= 1) {
921
- fileName = fileInfoArray[1];
922
- fileName = decodeURIComponent(fileName);
923
- fileName = fileName.replaceAll("\"", "");
924
- }
925
- }
926
- }
927
- }
928
-
929
- var type = xhr.getResponseHeader("content-type");
930
-
931
- if (!type) {
932
- type = "application/octet-stream";
933
- }
934
-
935
- var blob = new Blob([result], {
936
- type: type
937
- });
938
- (0, _fileSaver.saveAs)(blob, fileName);
939
- };
940
-
941
- ajaxOptions.error = function (error) {
942
- console.log('ajaxOptions :', error);
943
- };
944
-
945
- var deferred = window.$.ajax(ajaxOptions);
946
-
947
- if (this.isUseDefaultExceptionHandler()) {
948
- return this.__toStdPromise(deferred, failedDealFunction);
949
- } else {
950
- return this.__toStdPromise(deferred);
951
- }
952
- },
953
- createRequestURL: function createRequestURL(requestURL, params) {
954
- var lastRequestURL = this.getRequestPath(requestURL);
955
-
956
- if (!params) {
957
- return lastRequestURL;
958
- } else if (_lodash["default"].isString(params)) {
959
- if (requestURL.includes('?')) {
960
- var requestURLData = _queryString["default"].parseUrl(requestURL);
961
-
962
- if (JSON.stringify(requestURLData.query) === '{}') {
963
- return "".concat(requestURL).concat(params);
964
- }
965
-
966
- return "".concat(requestURL, "&").concat(params);
967
- }
968
-
969
- return "".concat(requestURL, "?").concat(params);
970
- } else if (_lodash["default"].isPlainObject(params)) {
971
- if (requestURL.includes('?')) {
972
- var _requestURLData = _queryString["default"].parseUrl(requestURL);
973
-
974
- if (JSON.stringify(_requestURLData.query) === '{}') {
975
- return "".concat(requestURL).concat(this.encodeObject2ParameterString(params));
976
- }
977
-
978
- return "".concat(requestURL, "&").concat(this.encodeObject2ParameterString(params));
979
- }
980
-
981
- return "".concat(requestURL, "?").concat(this.encodeObject2ParameterString(params));
982
- }
983
- },
984
-
985
- /**
986
- * !important! <br/>
987
- * DoNot use this pointer in this function body.
988
- */
989
- dealAjaxException: function dealAjaxException(httpExceptionResponse) {
990
- var errorID = "[ClientTraceID=" + new Date().getTime() + "] ";
991
- var errorMsg = null;
992
-
993
- if (_lodash["default"].isString(httpExceptionResponse)) {
994
- errorMsg = httpExceptionResponse;
995
-
996
- _antd.message.error(errorMsg);
997
- } else if (httpExceptionResponse && (httpExceptionResponse.responseJSON || httpExceptionResponse.response)) {
998
- var responseJSON = httpExceptionResponse.responseJSON || (_utils.Strings.isNotBlankString(httpExceptionResponse.response) ? JSON.parse(httpExceptionResponse.response) : httpExceptionResponse.response);
999
- var responseJSONData = responseJSON.resultData || responseJSON.data;
1000
- var statusCode = responseJSON.statusCode;
1001
-
1002
- if (statusCode && statusCode > 40000 && statusCode < 50000) {
1003
- errorMsg = responseJSON.msg || responseJSON.message;
1004
-
1005
- _antd.message.error(errorMsg);
1006
-
1007
- console.error(errorID + "Http request error:" + errorMsg, httpExceptionResponse);
1008
-
1009
- if ((0, _AppKits.isNeedForceRedirect)()) {
1010
- setTimeout(function () {
1011
- (0, _AppKits.forceRedirectToForError)();
1012
- }, 300);
1013
- }
1014
-
1015
- return httpExceptionResponse;
1016
- }
1017
-
1018
- if (_utils.Values.isNotEmptyArray(responseJSONData)) {
1019
- var msgItemList = responseJSONData.map(function (msgItem) {
1020
- return /*#__PURE__*/_react["default"].createElement("li", null, msgItem);
1021
- });
1022
- var durationSeconds = responseJSONData.length * 1;
1023
- durationSeconds = durationSeconds < 3 ? 3 : durationSeconds;
1024
- var multiLineOpts = {
1025
- content: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", null, responseJSON.msg), /*#__PURE__*/_react["default"].createElement("ol", {
1026
- style: {
1027
- marginTop: 8,
1028
- paddingLeft: 0
1029
- }
1030
- }, msgItemList)),
1031
- duration: durationSeconds
1032
- };
1033
-
1034
- _antd.message.error(multiLineOpts);
1035
- } else {
1036
- if (responseJSON.error) {
1037
- if (_utils.Values.isNotBlankString(responseJSON.error.msg)) {
1038
- errorMsg = responseJSON.error.msg;
1039
- } else if (_utils.Values.isNotBlankString(responseJSON.error.message)) {
1040
- errorMsg = responseJSON.error.message;
1041
- } else if (_utils.Values.isNotBlankString(responseJSON.error)) {
1042
- errorMsg = responseJSON.error;
1043
- }
1044
-
1045
- if (_utils.Values.isNotBlankString(errorMsg)) {
1046
- _antd.message.error(errorMsg);
1047
- }
1048
- } else {
1049
- errorMsg = responseJSON.msg || responseJSON.message || responseJSON.err;
1050
-
1051
- if (_utils.Values.isNotBlankString(errorMsg)) {
1052
- _antd.message.error(errorMsg);
1053
- }
1054
- }
1055
- }
1056
-
1057
- console.error(errorID + "Http request error:" + errorMsg, httpExceptionResponse);
1058
- return httpExceptionResponse;
1059
- } else if (_utils.Values.isNotBlankString(httpExceptionResponse.message)) {
1060
- _antd.message.error(httpExceptionResponse.message);
1061
- } else if (httpExceptionResponse.status === 502) {
1062
- _antd.message.error("[502]服务正在重启,请稍后重试");
1063
- } else if (httpExceptionResponse.status === 200) {
1064
- _antd.message.error("[200]Http状态码为200,但是出错,可能的原因是数据格式转换异常,请排查。");
1065
- } else if (httpExceptionResponse.status === 404) {
1066
- var contentType = httpExceptionResponse.getResponseHeader("Content-Type");
1067
-
1068
- if (_utils.Values.isNotBlankString(contentType) && !contentType.toLowerCase().startsWith("application/json")) {
1069
- // because the request is always to for backend service
1070
- // but when failed, we always return json;
1071
- // when not json, that is always the backend service not available (not start);
1072
- _antd.message.error("[404] Not Found, 可能是后端服务尚未启动.");
1073
-
1074
- if ((0, _AppKits.isNeedForceRedirect)()) {
1075
- setTimeout(function () {
1076
- (0, _AppKits.forceRedirectToForError)();
1077
- }, 300);
1078
- }
1079
- } else {
1080
- _antd.message.error("[404] Not Found(所请求的资源不存在)");
1081
- }
1082
- } else if (httpExceptionResponse.status === 0 || httpExceptionResponse.readyState === 0) {
1083
- _antd.message.error("应用服务链路不通:请联系管理员检查应用服务是否已启动.");
1084
- } else if (httpExceptionResponse.status && httpExceptionResponse.statusText) {
1085
- var errorTip = "[" + httpExceptionResponse.status + "] " + httpExceptionResponse.statusText;
1086
-
1087
- _antd.message.error(errorTip);
1088
- }
1089
-
1090
- console.error(errorID + "Maybe Http request error or Unresolved promise message:", httpExceptionResponse);
1091
- return httpExceptionResponse;
1092
- },
1093
- __toStdPromise: function __toStdPromise(deferred, failedDealFunction) {
1094
- if (failedDealFunction === null || failedDealFunction === void 0) {
1095
- return Promise.resolve(deferred);
1096
- }
1097
-
1098
- return Promise.resolve(deferred)["catch"](failedDealFunction);
1099
483
  }
1100
484
  };
1101
485
  var _default = http;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bchr/bchr-front-lib",
3
- "version": "0.5.1-alpha-20241221",
3
+ "version": "0.5.2",
4
4
  "description": "bchr front lib",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1,6 +1,5 @@
1
1
  import lodash from "lodash";
2
2
  import LangTypes from "./LangTypes"
3
- import IllegalArgumentError from "../error/IllegalArgumentError"
4
3
 
5
4
  const isWhitespace = function(c) {
6
5
  if (c === null || c === void 0) {
@@ -48,7 +47,7 @@ const Strings = {
48
47
  }
49
48
 
50
49
  if (!lodash.isString(value)) {
51
- throw new IllegalArgumentError("Invalid value [" + value + "] for Strings#removeBlankStrings");
50
+ throw new Error("Invalid value [" + value + "] for Strings#removeBlankStrings");
52
51
  }
53
52
 
54
53
  let lastString = "";