|
|
|
|
@ -5100,7 +5100,7 @@ var StudentTeam_competitionsPage = function competitionsPage(_ref) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验身份证号的正则表达式(适用于18位)
|
|
|
|
|
var idCardRegex = /^[1-9]\d{5}(18|19|20)\d{2}(0[1-9]|1[0-2])([0-2][1-9]|3[0-1])\d{3}[\dXx]$/;
|
|
|
|
|
var idCardRegex = /(^[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]$)|(^([A-Z]\d{6,10}(\(\w{1}\))?)$)/;
|
|
|
|
|
|
|
|
|
|
// 校验身份证的加权校验码
|
|
|
|
|
function validateIdCard(idCard) {
|
|
|
|
|
@ -6615,27 +6615,32 @@ var StudentTeam_competitionsPage = function competitionsPage(_ref) {
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入身份证号"
|
|
|
|
|
},
|
|
|
|
|
}, {
|
|
|
|
|
pattern: /(^[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]$)|(^([A-Z]\d{6,10}(\(\w{1}\))?)$)/,
|
|
|
|
|
message: '请输入正确的身份证号'
|
|
|
|
|
}
|
|
|
|
|
// { type: "string", max: 60, message: "输入超限,请缩减字符数" },
|
|
|
|
|
// { type: "string", whitespace: true, message: "内容不能全为空格" }
|
|
|
|
|
{
|
|
|
|
|
validator: function validator(_, value) {
|
|
|
|
|
if (!value) {
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 格式校验
|
|
|
|
|
if (!idCardRegex.test(value)) {
|
|
|
|
|
return Promise.reject(new Error('身份证号格式不正确'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验码校验
|
|
|
|
|
if (!validateIdCard(value)) {
|
|
|
|
|
return Promise.reject(new Error('身份证号不合法'));
|
|
|
|
|
}
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
}
|
|
|
|
|
}],
|
|
|
|
|
// {
|
|
|
|
|
// validator: (_, value) => {
|
|
|
|
|
// if (!value) {
|
|
|
|
|
// return Promise.resolve();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // 格式校验
|
|
|
|
|
// if (!idCardRegex.test(value)) {
|
|
|
|
|
// return Promise.reject(new Error('身份证号格式不正确'));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // 校验码校验
|
|
|
|
|
// if (!validateIdCard(value)) {
|
|
|
|
|
// return Promise.reject(new Error('身份证号不合法'));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// return Promise.resolve();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
maxLength: 18,
|
|
|
|
|
showCount: true,
|
|
|
|
|
@ -17256,31 +17261,31 @@ var NewCompetitionsPage = function NewCompetitionsPage(_ref) {
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入身份证号"
|
|
|
|
|
}, {
|
|
|
|
|
type: "string",
|
|
|
|
|
max: 18,
|
|
|
|
|
message: "输入超限,请缩减字符数"
|
|
|
|
|
}, {
|
|
|
|
|
type: "string",
|
|
|
|
|
whitespace: true,
|
|
|
|
|
message: "内容不能全为空格"
|
|
|
|
|
}, {
|
|
|
|
|
validator: function validator(_, value) {
|
|
|
|
|
if (!value) {
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 格式校验
|
|
|
|
|
if (!idCardRegex.test(value)) {
|
|
|
|
|
return Promise.reject(new Error('身份证号格式不正确'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验码校验
|
|
|
|
|
if (!validateIdCard(value)) {
|
|
|
|
|
return Promise.reject(new Error('身份证号不合法'));
|
|
|
|
|
}
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
}
|
|
|
|
|
}],
|
|
|
|
|
pattern: /(^[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]$)|(^([A-Z]\d{6,10}(\(\w{1}\))?)$)/,
|
|
|
|
|
message: '请输入正确的身份证号'
|
|
|
|
|
}
|
|
|
|
|
// { type: "string", max: 18, message: "输入超限,请缩减字符数" },
|
|
|
|
|
// { type: "string", whitespace: true, message: "内容不能全为空格" },
|
|
|
|
|
// {
|
|
|
|
|
// validator: (_, value) => {
|
|
|
|
|
// if (!value) {
|
|
|
|
|
// return Promise.resolve();
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // 格式校验
|
|
|
|
|
// if (!idCardRegex.test(value)) {
|
|
|
|
|
// return Promise.reject(new Error('身份证号格式不正确'));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // 校验码校验
|
|
|
|
|
// if (!validateIdCard(value)) {
|
|
|
|
|
// return Promise.reject(new Error('身份证号不合法'));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// return Promise.resolve();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
maxLength: 18,
|
|
|
|
|
showCount: true,
|