更新一下账号的正则表达式

This commit is contained in:
luchenqun 2017-02-08 20:37:37 +08:00
parent 1ee1d73a99
commit 44814144e9
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ app.controller('loginCtr', ['$scope', '$filter', '$state', '$cookieStore', 'book
$scope.passwordRegister2 = ""; $scope.passwordRegister2 = "";
return; return;
} }
if (!/([0-9a-zA-Z]){3,12}/.test($scope.usernameRegister)) { if (!/^[A-Za-z0-9]{3,12}$/.test($scope.usernameRegister)) {
toastr.error('账号只能是数字字母且长度必须为3到12位', "错误"); toastr.error('账号只能是数字字母且长度必须为3到12位', "错误");
return; return;
} }