Commit beef2211 by tang

feat: 注册优化

parent a771d7d0
...@@ -10,7 +10,11 @@ ...@@ -10,7 +10,11 @@
:rules="[{ :rules="[{
required: true, required: true,
message: '不能为空', message: '不能为空',
}]"> },
{
pattern: usernamePattern,
message: '注:用户名不能全为数字,且长度不得超过10字符',
},]">
<el-input v-model='form.userName' autocomplete='off'></el-input> <el-input v-model='form.userName' autocomplete='off'></el-input>
</el-form-item> </el-form-item>
...@@ -62,7 +66,7 @@ ...@@ -62,7 +66,7 @@
prop='password' prop='password'
type='password' type='password'
:rules="[{required: true,message: '不能为空',}, :rules="[{required: true,message: '不能为空',},
{ pattern: pwdPattern, message: '密码需要6~16位数字+字母组合',}, { pattern: pwdPattern, message: '密码为6~20位字符'},
{ validator:validatePass,}]"> { validator:validatePass,}]">
<el-input type='password' placeholder="请输入密码" v-model='form.password'></el-input> <el-input type='password' placeholder="请输入密码" v-model='form.password'></el-input>
</el-form-item> </el-form-item>
...@@ -110,8 +114,9 @@ export default { ...@@ -110,8 +114,9 @@ export default {
rePassword: '', rePassword: '',
validate: '', validate: '',
}, },
usernamePattern: /(?!\d+$)[\dA-Za-z\u4e00-\u9fa5]{1,10}$/,
mobilePattern: /^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(147))\d{8}$/, mobilePattern: /^((13[0-9])|(15[^4])|(18[0-9])|(17[0-8])|(147))\d{8}$/,
pwdPattern: /^(?=.*[a-zA-Z])(?=.*[0-9])[A-Za-z0-9]{6,16}$/, pwdPattern: /[A-Za-z0-9_]{6,20}$/,
} }
}, },
methods: { methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment