u
This commit is contained in:
1 parent
c4bd60d0cc
commit
fe15bfd35f
5 files changed
+664
-184
No files matched your search
@@ -56,14 +56,14 @@ const formRules = {
|
||||
],
|
||||
}
|
||||
|
||||
const saveLoading = ref(false)
|
||||
const submitLoading = ref(false)
|
||||
|
||||
async function submitForm(formEl: FormInstance | undefined) {
|
||||
if (!formEl)
|
||||
return
|
||||
await formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
saveLoading.value = true
|
||||
submitLoading.value = true
|
||||
loginApi({
|
||||
loginCredential: form.loginCredential,
|
||||
password: form.password,
|
||||
@@ -87,7 +87,7 @@ async function submitForm(formEl: FormInstance | undefined) {
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
}).finally(() => {
|
||||
saveLoading.value = false
|
||||
submitLoading.value = false
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -164,7 +164,7 @@ function navigateTo(path: string) {
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="form-btn" :loading="saveLoading" @click="submitForm(formRef)">
|
||||
<el-button type="primary" class="form-btn" :loading="submitLoading" @click="submitForm(formRef)">
|
||||
登录
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
||||
Reference in new issue
Block a user