Browse Source

新增银行卡号验证

李书文 1 year ago
parent
commit
bd12f8abd6
1 changed files with 7 additions and 0 deletions
  1. 7 0
      common/graceChecker.js

+ 7 - 0
common/graceChecker.js

@@ -91,6 +91,13 @@ module.exports = {
 						return false;
 					}
 					break;
+				case 'bank':
+					var reg = /^[1-9]\d{9,29}$/;
+					if (!reg.test(data[rule[i].name])) {
+						this.error = rule[i].errorMsg;
+						return false;
+					}
+					break;
 				case 'phoneno':
 					var reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
 					if (data[rule[i].name]) {