diff --git a/nkebao/src/pages/login/login.module.scss b/nkebao/src/pages/login/login.module.scss index 45527883..5c2c55d2 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 25beeead..570bf016 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` : "获取验证码"}
-
+ )} {/* 用户协议 */}