|
|
|
@ -50,13 +50,7 @@ import { getCodeImg, register } from "@/api/login";
|
|
|
|
|
export default {
|
|
|
|
|
name: "Register",
|
|
|
|
|
data() {
|
|
|
|
|
const equalToPassword = (rule, value, callback) => {
|
|
|
|
|
if (this.registerForm.password !== value) {
|
|
|
|
|
callback(new Error("两次输入的密码不一致"));
|
|
|
|
|
} else {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
codeUrl: "",
|
|
|
|
|
registerForm: {
|
|
|
|
@ -65,21 +59,9 @@ export default {
|
|
|
|
|
confirmPassword: "",
|
|
|
|
|
code: "",
|
|
|
|
|
uuid: "",
|
|
|
|
|
user_type: "sys_user"
|
|
|
|
|
user_type: "user_register"
|
|
|
|
|
},
|
|
|
|
|
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: "请输入验证码" }]
|
|
|
|
|
},
|
|
|
|
|
loading: false,
|
|
|
|
|