|
|
@@ -106,9 +106,10 @@ const getVerifySmsCode = () => {
|
|
|
|
|
|
const onLogin = async (
|
|
|
formEl: FormInstance | undefined,
|
|
|
- submitType: number = 1
|
|
|
) => {
|
|
|
if (!formEl) return;
|
|
|
+ const submitType = showVerifySms.value ? 2 : 1;
|
|
|
+ // 1普通登录 2短信登录
|
|
|
const ref = submitType === 1 ? ruleFormRef : smsFormRef;
|
|
|
await ref.value.validate(valid => {
|
|
|
if (valid) {
|
|
|
@@ -258,7 +259,6 @@ onMounted(() => {
|
|
|
:model="ruleForm"
|
|
|
:rules="loginRules"
|
|
|
size="large"
|
|
|
- @submit.prevent
|
|
|
>
|
|
|
<Motion :delay="100">
|
|
|
<el-form-item prop="loginName">
|
|
|
@@ -329,7 +329,7 @@ onMounted(() => {
|
|
|
type="primary"
|
|
|
:loading="loading"
|
|
|
:disabled="disabled"
|
|
|
- @click="onLogin(ruleFormRef, 1)"
|
|
|
+ @click="onLogin(ruleFormRef)"
|
|
|
>
|
|
|
登录
|
|
|
</el-button>
|
|
|
@@ -389,7 +389,7 @@ onMounted(() => {
|
|
|
type="primary"
|
|
|
:loading="loading"
|
|
|
:disabled="disabled"
|
|
|
- @click="onLogin(smsFormRef, 2)"
|
|
|
+ @click="onLogin(smsFormRef)"
|
|
|
>
|
|
|
登录
|
|
|
</el-button>
|