注册校验修改

main
xy 3 weeks ago
parent 7072b88e33
commit b40c10e3da
  1. 30
      src/layout/loginPage.vue

@ -35,7 +35,7 @@
</div>
<div class="right">
<el-input type="password" v-model="formModel.password" style="border-color: #20bec8"
placeholder="请输入密码"></el-input>
placeholder="请输入密码" show-password></el-input>
</div>
</div>
</el-form-item>
@ -51,7 +51,7 @@
</div>
<div class="right">
<el-input type="password" v-model="formModel.repassword" style="border-color: #20bec8"
placeholder="请再次输入密码"></el-input>
placeholder="请再次输入密码" show-password></el-input>
</div>
</div>
</el-form-item>
@ -83,11 +83,11 @@
</div>
<div class="right">
<el-cascader placeholder="请选择所属班级" :props="props" style="width: 142%; height: 0.2344rem"
v-model="formModel.department" />
v-model="formModel.clssid" />
</div>
</div>
</el-form-item>
<!-- <el-cascader :props="props" style="width: 100%; height: 0.2344rem" v-model="formModel.department" /> -->
<!-- <el-cascader :props="props" style="width: 100%; height: 0.2344rem" v-model="formModel.clssid" /> -->
<el-form-item prop="studentNumb">
<div style="display: flex; align-items: center;">
<div class="left" style="display: flex; align-items: center ;width: 90px;">
@ -104,7 +104,7 @@
</div>
</div>
</el-form-item>
<el-form-item>
<el-form-item prop="mobile">
<div style="display: flex; align-items: center;">
<div class="left" style="display: flex; align-items: center ;width: 90px;">
<div style="padding-right: 10px; color: #1084c1">
@ -268,7 +268,7 @@ const formModel = ref({
password: "",
repassword: "",
name: "",
department: '',
clssid: '',
studentNumb: "",
mobile: '',
captcha: "",
@ -280,14 +280,15 @@ const getFacultiesList = async (data: any) => {
console.log(res, 'res11')
FacultiesList.value = res.result
}
const deepValues = ref([])
//
const props = {
lazy: true,
checkStrictly: true,
emitPath: false,
async lazyLoad(node: any, resolve: any) {
// console.log(node);
console.log(node);
deepValues.value = node.pathValues
await getFacultiesList({
primaryType: node.level + 1,
pid: node.value,
@ -319,7 +320,7 @@ const rules = {
{
min: 5,
max: 11,
message: "学号长度最小五位最大十位",
message: "学号长度最小五位最大十位",
trigger: ["change", "blur"],
},
],
@ -352,12 +353,20 @@ const rules = {
trigger: "blur",
},
],
mobile:[
{ required: true, message: "请输入手机号", trigger: "blur" },
{
pattern: /^1[3-9]\d{9}$/,
message: "手机号长度最小六位最大十五位",
trigger: ["change", "blur"],
},
]
};
const register = async () => {
await formRef.value.validate();
console.log("开始注册请求");
let data = {
department: formModel.value.department,
clssid: formModel.value.clssid,
mobile: formModel.value.mobile,
captcha: formModel.value.captcha,
checkKey: 1629428467008,
@ -365,6 +374,7 @@ const register = async () => {
username: formModel.value.username,
realname: formModel.value.name,
workno: formModel.value.studentNumb,
depid: deepValues.value.splice(0, 2).join(',')
};
const res: any = await sturegister(data)
if (res.code === 200) {

Loading…
Cancel
Save