cuiyalong 10 месяцев назад
Родитель
Сommit
730e58745b
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      frontend/src/views/Login.vue

+ 13 - 0
frontend/src/views/Login.vue

@@ -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) {
+        return ElMessage({
+            message: '密码不能为空!',
+            type: 'error',
+        })
+    }
+
     loading.value = true
     //TODO 这里需要调用后台方法实现登录
     try {