|
|
|
@ -63,7 +63,9 @@ const rules = {
|
|
|
|
|
if (loginSuccess.value || !value) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (loginRejectMessge.value.indexOf("企业") > -1) {
|
|
|
|
|
return new Error(loginRejectMessge.value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
@ -76,7 +78,9 @@ const rules = {
|
|
|
|
|
if (loginSuccess.value || !value) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (loginRejectMessge.value.indexOf("验证码") > -1) {
|
|
|
|
|
return new Error(loginRejectMessge.value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
@ -89,7 +93,9 @@ const rules = {
|
|
|
|
|
if (loginSuccess.value || !value) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (loginRejectMessge.value.indexOf("手机号") > -1) {
|
|
|
|
|
return new Error(loginRejectMessge.value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
@ -105,7 +111,9 @@ const rules = {
|
|
|
|
|
if (loginSuccess.value || !value) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (loginRejectMessge.value.indexOf("验证码") > -1) {
|
|
|
|
|
return new Error(loginRejectMessge.value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
@ -118,7 +126,9 @@ const rules = {
|
|
|
|
|
if (loginSuccess.value || !value) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (loginRejectMessge.value.indexOf("账号") > -1) {
|
|
|
|
|
return new Error(loginRejectMessge.value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
@ -131,7 +141,9 @@ const rules = {
|
|
|
|
|
if (loginSuccess.value || !value) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (loginRejectMessge.value.indexOf("密码") > -1) {
|
|
|
|
|
return new Error(loginRejectMessge.value);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
@ -140,6 +152,7 @@ const rules = {
|
|
|
|
|
|
|
|
|
|
function handleSubmit(e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
console.log(formRef.value,'formRef')
|
|
|
|
|
loginSuccess.value = true;
|
|
|
|
|
formRef.value.validate(async (errors) => {
|
|
|
|
|
if (!errors) {
|
|
|
|
@ -174,6 +187,7 @@ function handleSubmit(e) {
|
|
|
|
|
loginSuccess.value = false;
|
|
|
|
|
message.destroyAll();
|
|
|
|
|
message.info(msg || "登录失败");
|
|
|
|
|
formRef.value.validate();
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
loading.value = false;
|
|
|
|
@ -230,6 +244,7 @@ function handleSmsSubmit(e) {
|
|
|
|
|
}
|
|
|
|
|
loginSuccess.value = true;
|
|
|
|
|
// const { code, message: msg } = await userStore.login(params)
|
|
|
|
|
await userStore.setStorageToken(res.data);
|
|
|
|
|
await userStore.getInformation();
|
|
|
|
|
message.destroyAll();
|
|
|
|
|
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
|
|
|
|
@ -240,6 +255,7 @@ function handleSmsSubmit(e) {
|
|
|
|
|
message.destroyAll();
|
|
|
|
|
message.info(msg || "登录失败");
|
|
|
|
|
loginSuccess.value = false;
|
|
|
|
|
formRefSms.value.validate();
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
} finally {
|
|
|
|
|