diff --git a/src/views/login.vue b/src/views/login.vue index 9fa8503..04fd1c2 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -93,10 +93,12 @@ const login = async function () { form.value.password = '' form.value.account = '' ElMessage.error(result.msg) + loading.value = false //登录失败时重置loading状态 } } catch (error) { console.log('请求失败', error) ElMessage.error('登录失败,请检查账号密码') + loading.value = false // 发生异常时重置loading状态 } } //获取菜单树 @@ -278,4 +280,4 @@ onMounted(() => { linear-gradient(in oklch longer hue -2deg, #a00, #a00); background-size: 100% 2px, 100% 100%, 100% 100%; } - + \ No newline at end of file