validateMessageCN.js
1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defaultValidateMessagesCN = void 0;
var typeTemplate = '${title}的类型不是${type}';
var defaultValidateMessagesCN = {
default: '${title}未通过校验',
required: '${title}必填',
whitespace: '${title}不能为空',
date: {
format: '${title}的格式错误',
parse: '${title}无法被解析',
invalid: '${title}数据不合法'
},
types: {
string: typeTemplate,
method: typeTemplate,
array: typeTemplate,
object: typeTemplate,
number: typeTemplate,
date: typeTemplate,
boolean: typeTemplate,
integer: typeTemplate,
float: typeTemplate,
regexp: typeTemplate,
email: typeTemplate,
url: typeTemplate,
hex: typeTemplate
},
string: {
len: '${title}长度不是${len}',
min: '${title}长度不能小于${min}',
max: '${title}长度不能大于${max}',
range: '${title}长度需在${min}~${max}之间'
},
number: {
len: '${title}不等于${len}',
min: '${title}不能小于${min}',
max: '${title}不能大于${max}',
range: '${title}需在${min}~${max}之间'
},
array: {
len: '${title}长度不是${len}',
min: '${title}长度不能小于${min}',
max: '${title}长度不能大于${max}',
range: '${title}长度需在${min}~${max}之间'
},
pattern: {
mismatch: '${title}未通过正则判断${pattern}'
}
};
exports.defaultValidateMessagesCN = defaultValidateMessagesCN;