From 0a2168c4d9ef426b76ba40cc920d74223b775b55 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Mon, 7 Dec 2020 16:26:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AF=81=E4=BB=B6=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stdiet-ui/src/utils/ruoyi.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdiet-ui/src/utils/ruoyi.js b/stdiet-ui/src/utils/ruoyi.js index f73903fa7..6b7a99267 100644 --- a/stdiet-ui/src/utils/ruoyi.js +++ b/stdiet-ui/src/utils/ruoyi.js @@ -251,8 +251,9 @@ export function validatorIDCard(idcode, type) { msg: !result ? "身份证号码不合规" : "校验通过" } } else if (type === 2) { - const reg = /^([A-Z]\d{6,10}(\(\w{1}\))?)$/; - if (reg.test(idcode) === false) { + const hkReg = /^([A-Z]\d{6,10}(\(\w{1}\))?)$/; + const mcReg = /^[1|5|7][0-9]{6}\([0-9Aa]\)/; + if (!hkReg.test(idcode) && !mcReg.test(idcode)) { return {code: -1, msg: '港澳居民来往内地通行证号码不合规'}; } else { return {code: 1, msg: '校验通过'};