Commit 57e9a2ab authored by 石光辉's avatar 石光辉

去掉重复的身份验证匹配

parent 44c8e0f2
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
// return; // return;
// } // }
if (![self.userInputContactInfoModel.idNo isIDCards]) { if (![self.userInputContactInfoModel.idNo isIdentityCard]) {
[QGHUDManager showHud:@"输入的身份证不合规范"]; [QGHUDManager showHud:@"输入的身份证不合规范"];
return; return;
} }
......
...@@ -185,14 +185,7 @@ ...@@ -185,14 +185,7 @@
- (BOOL)isOnlyContainsNumberAndLetter; - (BOOL)isOnlyContainsNumberAndLetter;
/**
是否是身份证
判断类别:15位身份证 或者18位身份证 或者 17位+x
只判断了位数和最后一位
@return YES | NO
*/
- (BOOL)isIDCards;
@end @end
...@@ -415,12 +415,5 @@ ...@@ -415,12 +415,5 @@
return [pred evaluateWithObject:self]; return [pred evaluateWithObject:self];
} }
- (BOOL)isIDCards
{
NSString *regex = @"(^\\d{15}$)|(^\\d{17}(\\d|X|x)$)";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
return [pred evaluateWithObject:self];
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment