From aff4700a10c452beeae61218d9efc21ddc9cfe50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=94=E8=AE=B0=E6=9C=AC=E9=87=8C=E7=9A=84=E6=B0=B8?= =?UTF-8?q?=E5=B9=B3?= Date: Fri, 18 Jul 2025 16:30:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9C=AC=E6=AC=A1=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=85=E5=AE=B9=E5=A6=82=E4=B8=8B=20?= =?UTF-8?q?=E5=AD=98=E4=BA=86=E5=BE=AE=E4=BF=A1=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nkebao/src/pages/login/login.module.scss | 15 +++-- nkebao/src/pages/login/login.tsx | 81 ++++++++++-------------- 2 files changed, 43 insertions(+), 53 deletions(-) diff --git a/nkebao/src/pages/login/login.module.scss b/nkebao/src/pages/login/login.module.scss index 455278839..5c2c55d2d 100644 --- a/nkebao/src/pages/login/login.module.scss +++ b/nkebao/src/pages/login/login.module.scss @@ -262,7 +262,7 @@ .agreement-section { margin-bottom: 24px; - padding: 12px; + padding: 10px; background: #f8f9fa; border-radius: 10px; border: 1px solid #e5e5e5; @@ -271,15 +271,16 @@ .agreement-checkbox { display: flex; align-items: center; - gap: 8px; - font-size: 12px; + gap: 6px; + font-size: 11px; color: #666; - line-height: 1.4; + line-height: 1.3; white-space: nowrap; :global(.adm-checkbox) { margin-top: 0; flex-shrink: 0; + transform: scale(0.8); } } @@ -289,8 +290,9 @@ align-items: center; flex-wrap: nowrap; white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + overflow: visible; + text-overflow: clip; + font-size: 11px; } .agreement-link { @@ -298,6 +300,7 @@ cursor: pointer; text-decoration: none; white-space: nowrap; + font-size: 11px; &:hover { text-decoration: underline; diff --git a/nkebao/src/pages/login/login.tsx b/nkebao/src/pages/login/login.tsx index 25beeeade..570bf016e 100644 --- a/nkebao/src/pages/login/login.tsx +++ b/nkebao/src/pages/login/login.tsx @@ -7,7 +7,11 @@ import { UserOutline, } from "antd-mobile-icons"; import { useUserStore } from "@/store/module/user"; -import { loginWithPassword, loginWithCode, sendVerificationCode } from "./api"; +import { + loginWithPassword, + loginWithCode, + sendVerificationCode, +} from "@/api/auth"; import style from "./login.module.scss"; const Login: React.FC = () => { @@ -77,41 +81,12 @@ const Login: React.FC = () => { } }; - // 表单验证 - const validateForm = async () => { - try { - const values = await form.validateFields(); - - if (!agreeToTerms) { - Toast.show({ content: "请同意用户协议和隐私政策", position: "top" }); - return false; - } - - if (!validatePhone(values.phone)) { - Toast.show({ content: "请输入正确的11位手机号", position: "top" }); - return false; - } - - if (activeTab === "password" && !values.password) { - Toast.show({ content: "请输入密码", position: "top" }); - return false; - } - - if (activeTab === "verification" && !values.verificationCode) { - Toast.show({ content: "请输入验证码", position: "top" }); - return false; - } - - return values; - } catch (error) { - return false; - } - }; - // 登录处理 - const handleLogin = async () => { - const values = await validateForm(); - if (!values) return; + const handleLogin = async (values: any) => { + if (!agreeToTerms) { + Toast.show({ content: "请同意用户协议和隐私政策", position: "top" }); + return; + } setLoading(true); try { @@ -225,26 +200,36 @@ const Login: React.FC = () => { onFinish={handleLogin} > {/* 手机号输入 */} -
- +
+86
-
+ {/* 密码输入 */} {activeTab === "password" && ( -
- +
{ {showPassword ? : }
- + )} {/* 验证码输入 */} {activeTab === "verification" && ( -
- +
{ {countdown > 0 ? `${countdown}s` : "获取验证码"}
-
+ )} {/* 用户协议 */}