diff --git a/src/assets/pwdw_icon.svg b/src/assets/pwdw_icon.svg new file mode 100644 index 0000000..64b733d --- /dev/null +++ b/src/assets/pwdw_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/user_icon.svg b/src/assets/user_icon.svg new file mode 100644 index 0000000..222f061 --- /dev/null +++ b/src/assets/user_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/Test.vue b/src/views/Test.vue index 9426ed6..7229806 100644 --- a/src/views/Test.vue +++ b/src/views/Test.vue @@ -26,7 +26,6 @@ const onReturn = () => { menuId.value = 0 - eventBus.emit("menuId", 0) router.go(-1) } diff --git a/src/views/components/Footer.vue b/src/views/components/Footer.vue index 2823ef5..140dd82 100644 --- a/src/views/components/Footer.vue +++ b/src/views/components/Footer.vue @@ -2,7 +2,7 @@ @@ -24,7 +32,9 @@ import { ref } from "vue"; import { useRouter } from "vue-router"; import { showToast } from "vant"; import { login } from "@/services/user/userManager"; - +import logoSvg from '@/assets/logo.svg' +import userIconSvg from '@/assets/user_icon.svg' +import pwdIconSvg from '@/assets/pwdw_icon.svg' const router = useRouter(); // 定义用户名和密码的响应式变量 const username = ref(""); @@ -32,6 +42,10 @@ const password = ref(""); // 处理登录的函数 const handleLogin = async () => { + if(!username.value || !password.value){ + showToast('请输入用户名或密码!'); + return; + } const res = await login({ username: username.value, password: password.value }); if (res.success) { sessionStorage.setItem("token", res.data); @@ -42,6 +56,111 @@ const handleLogin = async () => { }; - diff --git a/src/views/login/login.css b/src/views/login/login.css deleted file mode 100644 index fd88598..0000000 --- a/src/views/login/login.css +++ /dev/null @@ -1,60 +0,0 @@ -.login-container { - position: relative; - width: 100vw; - height: 100vh; - overflow: hidden; - } - - .background-image { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-image: url('https://via.placeholder.com/1920x1080'); /* 替换为你自己的背景图 URL */ - background-size: cover; - background-position: center; - filter: blur(5px); - z-index: -1; - } - - .login-form { - position: absolute; - top: 50%; - left: 50%; - height: 600px; - transform: translate(-50%, -50%); - background-color: rgba(255, 255, 255, 0.8); - padding: 20px; - border-radius: 10px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); - text-align: center; - } - - .input-field { - width: 100%; - padding: 10px; - margin: 10px 0; - border: 1px solid #ccc; - border-radius: 5px; - } - - .login-button { - width: 100%; - padding: 10px; - background-color: #007bff; - color: white; - border: none; - border-radius: 5px; - cursor: pointer; - margin-top: 35%; - } - - .login-button:hover { - background-color: #0056b3; - } - - .login-user-input{ - width: 400px; - margin-top: 15%; - } \ No newline at end of file