ztxkutils 2.6.2 → 2.6.5
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/dist/index.js +2 -2
- package/dist/reqUrl-b17264f9.js +55 -0
- package/dist/reqUrl.js +1 -1
- package/dist/stompClient.js +2 -2
- package/dist/validate-41edecdf.js +78 -0
- package/dist/validate.d.ts +5 -0
- package/dist/validate.js +1 -1
- package/package.json +8 -5
- package/dist/_commonjsHelpers-bdec4bbd.js +0 -7
- package/dist/index.es-9d1d897e.js +0 -11120
- package/dist/purify.es-67effdac.js +0 -1609
- package/dist/request-d385a629.js +0 -2736
package/dist/index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
export { c as authority } from './authority-fad2028d.js';
|
2
2
|
export { d as dataModel } from './dataModel-1fbaff40.js';
|
3
3
|
export { t as tools } from './tools-d8a41730.js';
|
4
|
-
export { v as validate } from './validate-
|
4
|
+
export { v as validate } from './validate-41edecdf.js';
|
5
5
|
export { r as request } from './request-af3b5774.js';
|
6
|
-
export { r as reqUrl } from './reqUrl-
|
6
|
+
export { r as reqUrl } from './reqUrl-b17264f9.js';
|
7
7
|
import './tslib.es6-f9459658.js';
|
8
8
|
import 'dayjs';
|
9
9
|
import 'number-precision';
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/**
|
2
|
+
* @file 项目基本配置,包括各个环境的请求地址
|
3
|
+
*/
|
4
|
+
// 环境变量
|
5
|
+
function getReqUrl(processObj) {
|
6
|
+
var ENV = processObj.REACT_APP_ENV;
|
7
|
+
// api服务器各个环境地址
|
8
|
+
var ZT_API_DEV = processObj.REACT_APP_ZT_API_DEV || 'http://192.168.0.83:8000'; // 开发环境
|
9
|
+
var ZT_API_TEST = processObj.REACT_APP_ZT_API_TEST || window.location.origin; // 测试环境 https://192.168.0.135:8000
|
10
|
+
var ZT_API_STAGE = processObj.REACT_APP_ZT_API_STAGE || window.location.origin; // 阶段性环境 http://192.168.0.134:8000
|
11
|
+
var ZT_API_PRODUCT = processObj.REACT_APP_ZT_API_PRODUCT || window.location.origin; // 生产环境 http://dz.zmd.com.cn
|
12
|
+
var ZT_API_PUBLIC_PRODUCT = processObj.REACT_APP_ZT_API_PUBLIC_PRODUCT || 'https://dz.zmd.com.cn:48000'; // 生产环境外网api地址 http://dz.zmd.com.cn:8000
|
13
|
+
// 文件服务器
|
14
|
+
var ZT_FILE_PREVIEW_DEV = processObj.REACT_APP_ZT_FILE_PREVIEW_DEV || 'http://192.168.0.83:88'; // 开发环境
|
15
|
+
var ZT_FILE_PREVIEW_TEST = processObj.REACT_APP_ZT_FILE_PREVIEW_TEST || 'https://192.168.0.135:18012'; // 测试环境
|
16
|
+
var ZT_FILE_PREVIEW_STAGE = processObj.REACT_APP_ZT_FILE_PREVIEW_STAGE || 'http://192.168.0.134:8012'; // 阶段性环境
|
17
|
+
var ZT_FILE_PREVIEW_PRODUCT = processObj.REACT_APP_ZT_FILE_PREVIEW_PRODUCT ||
|
18
|
+
'https://dzfile.zmd.com.cn:8012'; // 生产环境
|
19
|
+
// 实际api请求地址
|
20
|
+
var ZT_API_BASEURL = ZT_API_DEV;
|
21
|
+
var ZT_API_PUBLICURL = ZT_API_PUBLIC_PRODUCT;
|
22
|
+
var ZT_FILE_BASEURL = ZT_FILE_PREVIEW_DEV;
|
23
|
+
if (ENV) {
|
24
|
+
switch (ENV.toLowerCase()) {
|
25
|
+
case 'zt-dev':
|
26
|
+
ZT_API_BASEURL = ZT_API_DEV;
|
27
|
+
ZT_API_PUBLICURL = ZT_API_DEV;
|
28
|
+
ZT_FILE_BASEURL = ZT_FILE_PREVIEW_DEV;
|
29
|
+
break;
|
30
|
+
case 'zt-test':
|
31
|
+
ZT_API_BASEURL = ZT_API_TEST;
|
32
|
+
ZT_API_PUBLICURL = ZT_API_TEST;
|
33
|
+
ZT_FILE_BASEURL = ZT_FILE_PREVIEW_TEST;
|
34
|
+
break;
|
35
|
+
case 'zt-stage':
|
36
|
+
ZT_API_BASEURL = ZT_API_STAGE;
|
37
|
+
ZT_API_PUBLICURL = ZT_API_STAGE;
|
38
|
+
ZT_FILE_BASEURL = ZT_FILE_PREVIEW_STAGE;
|
39
|
+
break;
|
40
|
+
case 'zt-product':
|
41
|
+
ZT_API_BASEURL = ZT_API_PRODUCT;
|
42
|
+
ZT_API_PUBLICURL = ZT_API_PUBLICURL;
|
43
|
+
ZT_FILE_BASEURL = ZT_FILE_PREVIEW_PRODUCT;
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
return { ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, ZT_API_PUBLICURL: ZT_API_PUBLICURL };
|
48
|
+
}
|
49
|
+
|
50
|
+
var reqUrl = /*#__PURE__*/Object.freeze({
|
51
|
+
__proto__: null,
|
52
|
+
getReqUrl: getReqUrl
|
53
|
+
});
|
54
|
+
|
55
|
+
export { getReqUrl as g, reqUrl as r };
|
package/dist/reqUrl.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { g as getReqUrl } from './reqUrl-
|
1
|
+
export { g as getReqUrl } from './reqUrl-b17264f9.js';
|
package/dist/stompClient.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import Stomp from 'stompjs';
|
1
|
+
import Stomp from 'zt-stompjs';
|
2
2
|
import SockJS from 'zt-sockjs-client';
|
3
3
|
import { g as getToken } from './authority-fad2028d.js';
|
4
4
|
|
@@ -108,7 +108,7 @@ var StompClient = /** @class */ (function () {
|
|
108
108
|
((_a = _this.connectWsConfig.reconnectionTime) !== null && _a !== void 0 ? _a : 3000);
|
109
109
|
setTimeout(function () {
|
110
110
|
_this.init();
|
111
|
-
}, timeInterval >
|
111
|
+
}, timeInterval > 10000 ? 10000 : timeInterval);
|
112
112
|
});
|
113
113
|
});
|
114
114
|
};
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/**
|
2
|
+
* @description 常用正则表达式
|
3
|
+
*/
|
4
|
+
var validate = {
|
5
|
+
/**
|
6
|
+
* @description 长度验证,最小长度字符,0-200个字符
|
7
|
+
*/
|
8
|
+
smallLenValidate: /^(?:\s*)[\s\S]{0,200}(?:\s*)$/,
|
9
|
+
/**
|
10
|
+
* @description 长度验证,中等长度字符,0-400个字符
|
11
|
+
*/
|
12
|
+
middleLenValidate: /^(?:\s*)[\s\S]{0,400}(?:\s*)$/,
|
13
|
+
/**
|
14
|
+
* @description 长度验证,最大长度字符,0-600个字符
|
15
|
+
*/
|
16
|
+
largeLenValidate: /^(?:\s*)[\s\S]{0,600}(?:\s*)$/,
|
17
|
+
/**
|
18
|
+
* @description 长度验证,最大长度字符,0-5000个字符
|
19
|
+
*/
|
20
|
+
maxlargeLenValidate: /^(?:\s*)[\s\S]{0,5000}(?:\s*)$/,
|
21
|
+
/**
|
22
|
+
* @description 电话号码验证
|
23
|
+
*/
|
24
|
+
// phoneValidate: /^1(3\d|4\d|5\d|6\d|7\d|8\d|9\d)\d{8}$/,
|
25
|
+
phoneValidate: /^[0-9]*$/,
|
26
|
+
/**
|
27
|
+
* @description 短信验证码 接受11位手机号
|
28
|
+
*/
|
29
|
+
shortPhoneValidate: /^1[0-9]{10}$/,
|
30
|
+
/**
|
31
|
+
* @description 身份证验证
|
32
|
+
* 18位 最后一位可以是X x
|
33
|
+
*/
|
34
|
+
idCardValidate: /^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,
|
35
|
+
/**
|
36
|
+
* @description 邮箱验证
|
37
|
+
*/
|
38
|
+
emailValidate: /^([\s\S])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,8})$/,
|
39
|
+
/**
|
40
|
+
* @description 密码验证
|
41
|
+
*/
|
42
|
+
passwordValidate: /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)])+$)^.{8,16}$/,
|
43
|
+
/**
|
44
|
+
* @description 空格验证
|
45
|
+
*/
|
46
|
+
spaceValidate: /^[^\s]*$/g,
|
47
|
+
};
|
48
|
+
var commonMessage = {
|
49
|
+
smallLenMessage: function (type) {
|
50
|
+
if (type === void 0) { type = ''; }
|
51
|
+
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6200";
|
52
|
+
},
|
53
|
+
middleLenMessage: function (type) {
|
54
|
+
if (type === void 0) { type = ''; }
|
55
|
+
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6400";
|
56
|
+
},
|
57
|
+
largeLenMessage: function (type) {
|
58
|
+
if (type === void 0) { type = ''; }
|
59
|
+
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA6600";
|
60
|
+
},
|
61
|
+
maxlargeLenValidate: function (type) {
|
62
|
+
if (type === void 0) { type = ''; }
|
63
|
+
return type + "\u8D85\u8FC7\u6700\u5927\u5B57\u7B26\u957F\u5EA65000";
|
64
|
+
},
|
65
|
+
phoneMessage: '请输入正确的手机号',
|
66
|
+
idCardMessage: '请输入正确的身份证',
|
67
|
+
emailMessage: '请输入正确的邮箱',
|
68
|
+
passwordMessage: '密码由8-16位的字母+数字,字母+特殊字符,数字+特殊字符组成',
|
69
|
+
spaceMessage: '请勿输入空格',
|
70
|
+
};
|
71
|
+
|
72
|
+
var validate$1 = /*#__PURE__*/Object.freeze({
|
73
|
+
__proto__: null,
|
74
|
+
validate: validate,
|
75
|
+
commonMessage: commonMessage
|
76
|
+
});
|
77
|
+
|
78
|
+
export { validate as a, commonMessage as c, validate$1 as v };
|
package/dist/validate.d.ts
CHANGED
@@ -14,6 +14,10 @@ declare const validate: {
|
|
14
14
|
* @description 长度验证,最大长度字符,0-600个字符
|
15
15
|
*/
|
16
16
|
largeLenValidate: RegExp;
|
17
|
+
/**
|
18
|
+
* @description 长度验证,最大长度字符,0-5000个字符
|
19
|
+
*/
|
20
|
+
maxlargeLenValidate: RegExp;
|
17
21
|
/**
|
18
22
|
* @description 电话号码验证
|
19
23
|
*/
|
@@ -44,6 +48,7 @@ declare const commonMessage: {
|
|
44
48
|
smallLenMessage(type?: string): string;
|
45
49
|
middleLenMessage(type?: string): string;
|
46
50
|
largeLenMessage(type?: string): string;
|
51
|
+
maxlargeLenValidate(type?: string): string;
|
47
52
|
phoneMessage: string;
|
48
53
|
idCardMessage: string;
|
49
54
|
emailMessage: string;
|
package/dist/validate.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { c as commonMessage, a as validate } from './validate-
|
1
|
+
export { c as commonMessage, a as validate } from './validate-41edecdf.js';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ztxkutils",
|
3
|
-
"version": "2.6.
|
3
|
+
"version": "2.6.5",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/index.js",
|
@@ -30,6 +30,8 @@
|
|
30
30
|
"eslint-config-prettier": "^8.1.0",
|
31
31
|
"eslint-plugin-prettier": "^3.3.1",
|
32
32
|
"eslint-webpack-plugin": "^2.5.4",
|
33
|
+
"html2canvas": "^1.4.1",
|
34
|
+
"jspdf": "^2.5.1",
|
33
35
|
"lodash": "^4.17.21",
|
34
36
|
"number-precision": "^1.5.0",
|
35
37
|
"prettier": "^2.2.1",
|
@@ -49,17 +51,18 @@
|
|
49
51
|
"screenfull": "^5.1.0",
|
50
52
|
"sockjs-client": "^1.5.1",
|
51
53
|
"stompjs": "^2.3.3",
|
52
|
-
"zt-sockjs-client": "^0.0.1"
|
54
|
+
"zt-sockjs-client": "^0.0.1",
|
55
|
+
"zt-stompjs": "^1.0.3"
|
53
56
|
},
|
54
57
|
"peerDependencies": {
|
55
58
|
"axios": ">=0.21.1",
|
56
59
|
"dayjs": ">=1.10.4",
|
60
|
+
"html2canvas": ">=1.4.1",
|
61
|
+
"jspdf": ">=2.5.1",
|
57
62
|
"lodash": ">=4.17.21",
|
58
63
|
"number-precision": ">=1.5.0",
|
59
64
|
"react": ">=17.0.1",
|
60
65
|
"react-dom": ">=17.0.1",
|
61
|
-
"ztxkui": ">=0.4.1"
|
62
|
-
"jspdf": ">=2.5.1",
|
63
|
-
"html2canvas": ">=1.4.1"
|
66
|
+
"ztxkui": ">=0.4.1"
|
64
67
|
}
|
65
68
|
}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
2
|
-
|
3
|
-
function commonjsRequire (path) {
|
4
|
-
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
5
|
-
}
|
6
|
-
|
7
|
-
export { commonjsRequire as a, commonjsGlobal as c };
|