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

Commit

Permalink
fix: (issue #354) 注册用户名数字校验优先级调整
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jun 13, 2018
1 parent 1646ed7 commit ae356f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/page/signup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,18 +287,18 @@ export default {
verifiable_type: verifiableType
} = this.$data;
// 判断特殊字符及空格
if (!usernameReg.test(name)) {
this.$Message.error({ name: "用户名不能包含特殊符号以及空格" });
return;
}
// 判断首字符是否为数字
if (!isNaN(name[0])) {
this.$Message.error({ name: "用户名不能以数字开头" });
return;
}
// 判断特殊字符及空格
if (!usernameReg.test(name)) {
this.$Message.error({ name: "用户名不能包含特殊符号以及空格" });
return;
}
// 判断字节数
if (strLength(name) > 48 || strLength(name) < 4) {
this.$Message.error({ name: "用户名不能少于2个中文或4个英文" });
Expand Down

0 comments on commit ae356f1

Please sign in to comment.