Explorar o código

完善手机号验证

ChenLiang %!s(int64=4) %!d(string=hai) anos
pai
achega
d3ac53d449
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      插件/common.js

+ 3 - 4
插件/common.js

@@ -277,12 +277,11 @@ var comm = {
     },
     /* ====================================================================================== */
 
-    isPoneAvailable: function (pone) { // 判断是否为有效手机号
-        var myreg = /^[1][3,4,5,7,8][0-9]{9}$/;
-        if (!myreg.test(pone)) {
+    isPhone: function (phone) { // 判断是否为有效手机号
+        if (!(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/.test(phone))) {
             return false;
         } else {
-            return true;
+            return true
         }
     },
     timestamp: function (time) { // 转换时间格式