外国人永久居住证15性别校验修改

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2024-02-22 16:30:20 +08:00
parent 8092c2b2c5
commit 9b067a1821

View File

@@ -54,8 +54,8 @@ function getBirthById(idNo) {
function getSexById(idNo) {
if(idNo.length == 15){
// 获取性别
if (idNo.charAt(14) >= '0' && idNo.charAt(14) <= '9') {
if (parseInt(idNo.charAt(14)) % 2 == 0) {
if (idNo.charAt(13) >= '0' && idNo.charAt(13) <= '9') {
if (parseInt(idNo.charAt(13)) % 2 == 0) {
return '1'
} else {
return '0'
@@ -128,6 +128,8 @@ export function idNoCheck8(userInfo) {
}
let thisSex = getSexById(userInfo.idNo)
if(thisSex != userInfo.sex) {
console.log('sexxxxxx',thisSex)
console.log('sexxxxxx',userInfo.sex)
return {
text: '性别必须与证件号码中的一致'
}