@@ -40,6 +40,19 @@ const form = ref({})
const loading = ref(false)
//
const doLogin = async () => {
+ if (!form.value.username) {
+ return ElMessage({
+ message: '用户名不能为空!',
+ type: 'error',
+ })
+ }
+ if (!form.value.password) {
+ message: '密码不能为空!',
+
loading.value = true
//TODO 这里需要调用后台方法实现登录
try {