master
chengqf 2 years ago
parent bc2e333165
commit cf5b91d172

@ -50,13 +50,7 @@ import { getCodeImg, register } from "@/api/login";
export default { export default {
name: "Register", name: "Register",
data() { data() {
const equalToPassword = (rule, value, callback) => {
if (this.registerForm.password !== value) {
callback(new Error("两次输入的密码不一致"));
} else {
callback();
}
};
return { return {
codeUrl: "", codeUrl: "",
registerForm: { registerForm: {
@ -65,21 +59,9 @@ export default {
confirmPassword: "", confirmPassword: "",
code: "", code: "",
uuid: "", uuid: "",
user_type: "sys_user" user_type: "user_register"
}, },
registerRules: { registerRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" },
{ min: 2, max: 20, message: '用户账号长度必须介于 2 和 20 之间', trigger: 'blur' }
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' }
],
confirmPassword: [
{ required: true, trigger: "blur", message: "请再次输入您的密码" },
{ required: true, validator: equalToPassword, trigger: "blur" }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }] code: [{ required: true, trigger: "change", message: "请输入验证码" }]
}, },
loading: false, loading: false,

Loading…
Cancel
Save