Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix: ( #341 ) 修改手机号验证
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonleex committed Mar 29, 2018
1 parent 7777059 commit b37966e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/page/forgot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
<script>
const SMS = "sms"; // 手机
const EMAIL = "mail"; // 邮箱
const phoneReg = /^(((13[0-9]{1})|14[0-9]{1}|(15[0-9]{1})|17[0-9]{1}|(18[0-9]{1}))+\d{8})$/;
// const phoneReg = /^(((13[0-9]{1})|14[0-9]{1}|(15[0-9]{1})|17[0-9]{1}|(18[0-9]{1}))+\d{8})$/;
const phoneReg = /^1[345678]\d{9}$/;
const emailReg = /^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
export default {
Expand Down
4 changes: 2 additions & 2 deletions src/page/signup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<input
id="phone"
v-model.trim='phone'
type="number"
type="text"
maxlength="11"
placeholder="输入11位手机号"
@input="phone = phone.length > 11 ? phone.slice(0,11) : phone"
Expand Down Expand Up @@ -149,7 +149,7 @@ const SMS = "sms"; // 手机
const EMAIL = "mail"; // 邮箱
// 手机号码规则
const phoneReg = /^(((13[0-9]{1})|14[0-9]{1}|(15[0-9]{1})|17[0-9]{1}|(18[0-9]{1}))+\d{8})$/;
const phoneReg = /^1[345678]\d{9}$/;
// 邮箱验证
const emailReg = /^\w+((-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// 用户名验证
Expand Down

0 comments on commit b37966e

Please sign in to comment.