Commit 540f4277 authored by moonby's avatar moonby

登录页优化

parent 71f558aa
...@@ -210,7 +210,8 @@ import { ...@@ -210,7 +210,8 @@ import {
getCurrentInstance, getCurrentInstance,
onMounted, onMounted,
onUpdated, onUpdated,
onBeforeUnmount onBeforeUnmount,
handleError
} from 'vue'; } from 'vue';
import { User, Lock } from '@element-plus/icons-vue' import { User, Lock } from '@element-plus/icons-vue'
...@@ -290,7 +291,7 @@ function login() { ...@@ -290,7 +291,7 @@ function login() {
} }
loading.value = true; loading.value = true;
userInfo.verificationCode = code.value; userInfo.verificationCode = code.value;
code.value='';
http.post('/api/user/login', userInfo, '正在登录....').then((result) => { http.post('/api/user/login', userInfo, '正在登录....').then((result) => {
if (!result.success) { if (!result.success) {
loading.value = false; loading.value = false;
...@@ -306,4 +307,11 @@ function login() { ...@@ -306,4 +307,11 @@ function login() {
}); });
} }
function handleKeyEvent(event){
if(event.key === 'Enter'){
login();
}
}
window.addEventListener('keydown',handleKeyEvent);
</script> </script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment