diff --git a/src/api/index.js b/src/api/index.js
index db0501b..38d130d 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -64,4 +64,4 @@ api.interceptors.response.use(
}
)
-export default api
\ No newline at end of file
+export default api
diff --git a/src/api/user.js b/src/api/user.js
index 89c6f92..693f2c4 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -51,4 +51,4 @@ export const userApi = {
deleteUsers(ids) {
return api.delete('/sysUser/batch', { data: { ids } })
}
-}
\ No newline at end of file
+}
diff --git a/src/views/Login.vue b/src/views/Login.vue
index 740a4b9..c54f1eb 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -6,50 +6,45 @@
部署管理系统
-
-
-
-
-
-
-
-
+
@@ -58,30 +53,29 @@
import { ref, reactive } from 'vue'
import { useRouter } from 'vue-router'
import { MessagePlugin } from 'tdesign-vue-next'
+
import { userApi } from '@/api/user'
import auth from '@/utils/auth'
const router = useRouter()
-const form = ref()
const loading = ref(false)
const formData = reactive({
- username: '',
- password: ''
+ account: '',
+ password: '',
+ checked: true
})
-const rules = {
- username: [
- { required: true, message: '请输入用户名', type: 'error' }
- ],
- password: [
- { required: true, message: '请输入密码', type: 'error' }
- ]
-}
-
const handleSubmit = async () => {
- const valid = await form.value.validate()
- if (!valid) return
+ // 简单的表单验证
+ if (!formData.account.trim()) {
+ MessagePlugin.error('请输入用户名')
+ return
+ }
+ if (!formData.password.trim()) {
+ MessagePlugin.error('请输入密码')
+ return
+ }
loading.value = true
@@ -147,10 +141,18 @@ const handleSubmit = async () => {
margin: 0;
}
-:deep(.t-form-item) {
+.login-form {
+ margin-top: 32px;
+}
+
+.form-item {
margin-bottom: 24px;
}
+.form-item:last-child {
+ margin-bottom: 0;
+}
+
:deep(.t-input) {
border-radius: 8px;
}
diff --git a/vite.config.js b/vite.config.js
index 183cb54..41d8d25 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -17,11 +17,11 @@ export default defineConfig({
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, '')
+ rewrite: (path) => path
}
}
},
build: {
outDir: 'dist'
}
-})
\ No newline at end of file
+})