From 926e26b3972b8b2a450110a817c0688bee930a6b Mon Sep 17 00:00:00 2001 From: zhanjunhao <642307404@qq.com> Date: Wed, 18 Nov 2026 17:27:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E7=BB=9F=E4=B8=80=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E9=A1=B5=E8=BE=93=E5=85=A5=E6=A1=86=2036px=20=E4=B8=8E?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/CHANGELOG.md | 10 +- docs/ui/GLOBAL_UI_BASELINE.md | 6 +- src/components/auth/AuthCardHeader.jsx | 14 +- src/components/auth/AuthDivider.jsx | 35 ++++ src/components/auth/GlassCard.jsx | 8 +- src/components/auth/LoginForm.jsx | 132 ++++-------- src/components/auth/PasswordResetConfirm.jsx | 208 +++++++++---------- src/components/auth/PasswordResetForm.jsx | 149 ++++++------- src/components/auth/RegisterForm.jsx | 160 +++++--------- src/components/auth/TwoFAVerification.jsx | 16 +- src/components/layout/PageLayout.jsx | 7 +- src/pages/OrgLogin/index.jsx | 12 +- src/pages/OrgRegister/index.jsx | 41 +--- src/styles/prototype.css | 139 ++++++++++++- 14 files changed, 472 insertions(+), 465 deletions(-) create mode 100644 src/components/auth/AuthDivider.jsx diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6aacbe1c..1a5a9611 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,6 @@ # 变更记录(CHANGELOG) -> 状态:有效(持续追加) · 更新:2026-11-18 · 版本:v3.3 +> 状态:有效(持续追加) · 更新:2026-11-18 · 版本:v3.4 对现状仍有影响的功能与修复记录,按日期倒序。改造、迁移、优化等一次性过程不在此记录。 @@ -10,6 +10,14 @@ ## 2026-11-18 +### 调整 · 认证页输入框 36px 与视觉统一 + +- **范围**:`/login`、`/org/login`、`/org/:slug/login`、`/register`、`/org/register`、`/reset`、`/user/reset`,以及两步验证、微信验证码弹窗。 +- **变更**:输入框、下拉、整行按钮统一 36px / 8px 圆角,字段节奏 24px;隐藏卡片外发光、角落光晕、漂移光斑与 Logo 光环 / 星标;第三方登录与注册提交按钮去掉渐变、扫光和上浮动效;新增 `AuthDivider` 统一分隔线;找回密码两页改用登录页同款背景、卡片与头部;六个认证页统一使用登录顶栏;两步验证链接色改用品牌色。 +- **影响**:仅视图层,保留请求、载荷、校验规则、提交触发与禁用条件;`OrgCredentialResult` 和 `/client/authorize` 不变。 +- **回滚**:按文件还原 `src/components/auth/`(含删除新增的 `AuthDivider.jsx`)、`src/pages/OrgLogin/index.jsx`、`src/pages/OrgRegister/index.jsx`、`src/components/layout/PageLayout.jsx`、`src/styles/prototype.css` 中的 `.auth-login-page` 段及 `GLOBAL_UI_BASELINE.md` 第 4.5 节。 +- **关联**:`docs/ui/GLOBAL_UI_BASELINE.md` 第 4.5 节。 + ### 规范 · 适配层日期契约、标签写法与控制台页头 - **范围**:`src/components/ui/controls.jsx`;`docs/standards/{DEV_STANDARDS,UI_COMPONENT_STANDARDS}.md`、`docs/ui/{ORG_CENTER_SPEC,CONSOLE_SPEC}.md`。 diff --git a/docs/ui/GLOBAL_UI_BASELINE.md b/docs/ui/GLOBAL_UI_BASELINE.md index 952cb881..69e402c9 100644 --- a/docs/ui/GLOBAL_UI_BASELINE.md +++ b/docs/ui/GLOBAL_UI_BASELINE.md @@ -1,6 +1,6 @@ # 后台 UI 全局基线 -> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-17 · 版本:v3.6 +> 状态:有效 · 适用:antd 6.7.0 · 更新:2026-11-18 · 版本:v3.7 后台外壳与布局基线:顶栏、侧栏、公告、页头与内容边距、登录页,以及原型未定义场景、登录关卡与验收流程。主题与组件样式见 `UI_COMPONENT_STANDARDS.md`。 @@ -80,8 +80,8 @@ ### 4.5 登录页与认证顶栏 -- `/org/login` 与 `/login` 顶栏采用后台标准样式,无品牌条、玻璃渐变与反光层。登录页局部布局 `.auth-login-page`;其他认证顶栏 `.auth-layout-header` 透出既有背景;登录顶栏 `.login-layout-header`。 -- 登录卡片无顶部装饰线与反光;企业 / 个人切换用 antd `Button`;输入框 34px 高、8px 圆角,必填标识经 `Form.Item` 呈现;凭据字段只预留必要的错误提示高度,正常、报错、修正三态布局稳定。 +- 认证页(`/login`、`/org/login`、`/org/:slug/login`、`/register`、`/org/register`、`/reset`、`/user/reset`)统一使用登录顶栏 `.login-layout-header` 与局部布局 `.auth-login-page`,顶栏采用后台标准样式,无品牌条、玻璃渐变与反光层;仅客户端授权页 `/client/authorize` 保留 `.auth-layout-header` 透出背景。 +- 登录卡片无顶部装饰线、反光、外发光、角落光晕与 Logo 光环 / 星标;企业 / 个人切换用 antd `Button`;输入框、下拉、整行按钮与认证弹窗(`.auth-login-modal`)控件统一 36px 高、8px 圆角(`--auth-control-height`),必填标识经 `Form.Item` 呈现;字段节奏 24px,凭据字段只预留必要的错误提示高度,正常、报错、修正三态布局稳定。第三方登录用描边整行按钮,无位移与扫光;分隔线用 `AuthDivider`。规则集中在 `src/styles/prototype.css` 的 `.auth-login-page` 段。 - 副标题、“记住登录名”、管理员重置提示与“忘记密码”使用加深 20% 的次文字色,无悬停底色,“忘记密码”悬停再加深;“切换企业”与“登录”同为主按钮样式。个人登录必填校验用 `rules`,通过后调用原登录处理函数。样式调整不得改变登录校验、回调与载荷。 ### 4.6 导航入口 diff --git a/src/components/auth/AuthCardHeader.jsx b/src/components/auth/AuthCardHeader.jsx index 5851ee8e..feef02ed 100644 --- a/src/components/auth/AuthCardHeader.jsx +++ b/src/components/auth/AuthCardHeader.jsx @@ -42,12 +42,12 @@ const AuthCardHeader = ({ const { t } = useTranslation(); return (
-
- {/* Logo 光环 */} -
-
+
+ {/* Logo 光环(.auth-login-page 认证页内隐藏,保持克制) */} +
+
{logoNode || (
-

+

{title}

diff --git a/src/components/auth/AuthDivider.jsx b/src/components/auth/AuthDivider.jsx new file mode 100644 index 00000000..796e0bfa --- /dev/null +++ b/src/components/auth/AuthDivider.jsx @@ -0,0 +1,35 @@ +/* +Copyright (C) 2025 QuantumNous + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as +published by the Free Software Foundation, either version 3 of the +License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see . + +For commercial licensing, please contact support@quantumnous.com +*/ + +import React from 'react'; + +/** + * 认证页统一的「— 文案 —」分隔线(如「或」「还没有企业?」)。 + * 两侧细线 + 居中弱化文字,不依赖底色遮挡,玻璃卡片与深色模式下都干净。 + * 样式见 src/styles/prototype.css 的 .auth-divider。 + */ +const AuthDivider = ({ children, className = '' }) => ( +

+
+); + +export default AuthDivider; diff --git a/src/components/auth/GlassCard.jsx b/src/components/auth/GlassCard.jsx index bbc969e1..d0225ca2 100644 --- a/src/components/auth/GlassCard.jsx +++ b/src/components/auth/GlassCard.jsx @@ -201,14 +201,14 @@ const GlassCard = ({ return (
- {/* 外环柔光晕 */} -
+ {/* 外环柔光晕(.auth-login-page 认证页内隐藏) */} +
{/* 左上 / 右下脉动光晕 */} {withCornerHalos && ( <> -
-
+
+
)} diff --git a/src/components/auth/LoginForm.jsx b/src/components/auth/LoginForm.jsx index 89e687d3..0b973915 100644 --- a/src/components/auth/LoginForm.jsx +++ b/src/components/auth/LoginForm.jsx @@ -71,6 +71,7 @@ import { Shield, Smartphone, QrCode } from 'lucide-react'; import GlassCard from './GlassCard'; import AuthCardHeader from './AuthCardHeader'; import AuthLoginTabs from './AuthLoginTabs'; +import AuthDivider from './AuthDivider'; import AgreementModal from '../common/DocumentRenderer/AgreementModal'; import { isMiniProgramWebView, @@ -93,38 +94,26 @@ const IS_MOBILE_DEVICE = ); // 提取OAuthButton到组件外部,避免每次渲染都重建 +// 第三方登录按钮:统一为 36px 描边按钮,无位移 / 扫光动效(尺寸见 prototype.css .auth-login-page) const OAuthButton = React.memo( - ({ icon, children, onClick, loading, disabled, iconColor, t }) => ( - + {children} + ), ); @@ -629,7 +618,7 @@ const LoginForm = () => { subtitle={t('请选择登录方式')} /> -
+
{status.wechat_login && ( } />} @@ -730,39 +719,22 @@ const LoginForm = () => { )} - {/* 分隔线 */} -
-
-
-
-
- - {t('或')} - -
-
+ {t('或')} {/* 邮箱登录按钮 */} - + {t('邮箱/用户名 登录')} +
{(hasUserAgreement || hasPrivacyPolicy) && ( -
+
setAgreedToTerms(e.target.checked)} @@ -801,7 +773,7 @@ const LoginForm = () => { )} {!status.self_use_mode_enabled && ( -
+
{t('没有账户?')}{' '} { )} {/* 安全提示 */} -
+
{t('安全登录')}
@@ -847,16 +819,7 @@ const LoginForm = () => { )} {status.passkey_login && passkeySupported && ( -
-
-
-
-
- - {t('或')} - -
-
+ {t('或')} )}
@@ -972,24 +935,15 @@ const LoginForm = () => { status.wechat_open_oauth || status.linuxdo_oauth || status.telegram_oauth) && ( -
-
-
-
-
-
- - {t('或')} - -
-
- - +
)} @@ -1008,7 +962,7 @@ const LoginForm = () => { )} {/* 安全提示 */} -
+
{t('安全登录')}
@@ -1040,7 +994,7 @@ const LoginForm = () => { okButtonProps={{ loading: wechatCodeSubmitLoading, }} - className='wechat-login-modal' + className='wechat-login-modal auth-login-modal' > {/* 移动端提示 */} {isMobileView && !isInWeChat && ( @@ -1103,7 +1057,6 @@ const LoginForm = () => { onChange={(value) => handleChange('wechat_verification_code', value) } - className='!rounded-xl' /> @@ -1192,11 +1145,11 @@ const LoginForm = () => { -
- +
+
-
{t('两步验证')}
+
{t('两步验证')}
{t('请输入验证码完成登录')}
@@ -1208,6 +1161,7 @@ const LoginForm = () => { footer={null} width={450} centered + className='auth-login-modal' > { const { t } = useTranslation(); @@ -108,121 +111,100 @@ const PasswordResetConfirm = () => { } return ( -
- {/* 背景模糊晕染球 */} -
-
-
-
-
-
- {t('网站标志')} + +
+ + + + {!isValidResetLink && ( + + )} +
setFormApi(api)} + initValues={{ + email: email || '', + newPassword: newPassword || '', + }} + > + } + placeholder={email ? '' : t('等待获取邮箱信息...')} + /> + + {newPassword && ( + } + suffix={ + + } /> - - {systemName} - + )} + +
+
+ - -
- - {t('密码重置确认')} - -
-
- {!isValidResetLink && ( - - )} -
setFormApi(api)} - initValues={{ - email: email || '', - newPassword: newPassword || '', - }} - className='space-y-4' - > - } - placeholder={email ? '' : t('等待获取邮箱信息...')} - /> - - {newPassword && ( - } - suffix={ - - } - /> - )} - -
- -
- - -
- - - {t('返回登录')} - - -
-
-
+
+ + + {t('返回登录')} + +
-
+
); diff --git a/src/components/auth/PasswordResetForm.jsx b/src/components/auth/PasswordResetForm.jsx index 6b78b8fe..e0ee43ad 100644 --- a/src/components/auth/PasswordResetForm.jsx +++ b/src/components/auth/PasswordResetForm.jsx @@ -27,12 +27,15 @@ import { getSystemName, } from '../../helpers'; import Turnstile from 'react-turnstile'; -import { Button, Card, Form, Typography } from '@/components/ui'; +import { Button, Form, Typography } from '@/components/ui'; import { IconMail } from '@/components/ui/icons'; import { Link } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; +import AuthBackground from '../common/AuthBackground'; +import GlassCard from './GlassCard'; +import AuthCardHeader from './AuthCardHeader'; -const { Text, Title } = Typography; +const { Text } = Typography; const PasswordResetForm = () => { const { t } = useTranslation(); @@ -104,91 +107,69 @@ const PasswordResetForm = () => { } return ( -
- {/* 背景模糊晕染球 */} -
-
-
-
-
-
- {t('网站标志')} - - {systemName} - +
+ +
+ + + +
+ } + /> + +
+
+ - -
- - {t('密码重置')} - -
-
-
- } - /> - -
- -
- - -
- - {t('想起来了?')}{' '} - - {t('登录')} - - -
-
-
- - {turnstileEnabled && ( -
- { - setTurnstileToken(token); - }} - /> -
- )} +
+ + {t('想起来了?')}{' '} + + {t('登录')} + +
-
+ + + {turnstileEnabled && ( +
+ { + setTurnstileToken(token); + }} + /> +
+ )}
); diff --git a/src/components/auth/RegisterForm.jsx b/src/components/auth/RegisterForm.jsx index aceea245..df1320a8 100644 --- a/src/components/auth/RegisterForm.jsx +++ b/src/components/auth/RegisterForm.jsx @@ -65,6 +65,7 @@ import AuthBackground from '../common/AuthBackground'; import GlassCard from './GlassCard'; import AuthCardHeader from './AuthCardHeader'; import AuthLoginTabs from './AuthLoginTabs'; +import AuthDivider from './AuthDivider'; import { Shield, Smartphone, QrCode } from 'lucide-react'; import AgreementModal from '../common/DocumentRenderer/AgreementModal'; import { @@ -459,7 +460,7 @@ const RegisterForm = () => { } }; - // 注册按钮样式组件 + // 第三方注册按钮:与登录页一致的 36px 描边按钮,无位移 / 扫光动效 const OAuthButton = ({ icon, children, @@ -468,36 +469,23 @@ const RegisterForm = () => { disabled, iconColor, }) => ( - + {children} + ); const renderOAuthOptions = () => { @@ -509,7 +497,7 @@ const RegisterForm = () => { subtitle={t('创建您的账户')} /> -
+
{status.wechat_login && ( } />} @@ -591,40 +579,23 @@ const RegisterForm = () => { )} - {/* 分隔线 */} -
-
-
-
-
- - {t('或')} - -
-
+ {t('或')} {/* 用户名注册按钮 */} - + {t('使用 用户名 注册')} +
{(hasUserAgreement || hasPrivacyPolicy) && ( -
+
setAgreedToTerms(e.target.checked)} @@ -662,7 +633,7 @@ const RegisterForm = () => {
)} -
+
{t('已有账户?')}{' '} {
{/* 安全提示 */} -
+
{t('安全注册')}
@@ -694,8 +665,7 @@ const RegisterForm = () => { logoWrapperClassName='mb-2' /> -
- {/* 用户名输入框 —— 玻璃观感统一由 .auth-glass-form(GlassCard 内置样式)驱动 */} + { } placeholder={t('请输入用户名')} name='username' - size='large' autoComplete='username' onChange={(value) => handleChange('username', value)} prefix={} @@ -722,7 +691,6 @@ const RegisterForm = () => { placeholder={t('输入密码,最短 8 位,最长 20 位')} name='password' mode='password' - size='large' autoComplete='new-password' onChange={(value) => handleChange('password', value)} prefix={} @@ -739,7 +707,6 @@ const RegisterForm = () => { placeholder={t('确认密码')} name='password2' mode='password' - size='large' autoComplete='new-password' onChange={(value) => handleChange('password2', value)} prefix={} @@ -757,7 +724,6 @@ const RegisterForm = () => { placeholder={t('输入邮箱地址')} name='email' type='email' - size='large' autoComplete='email' onChange={(value) => handleChange('email', value)} prefix={} @@ -784,7 +750,6 @@ const RegisterForm = () => { } placeholder={t('输入验证码')} name='verification_code' - size='large' onChange={(value) => handleChange('verification_code', value)} prefix={} /> @@ -792,7 +757,7 @@ const RegisterForm = () => { )} {(hasUserAgreement || hasPrivacyPolicy) && ( -
+
setAgreedToTerms(e.target.checked)} @@ -827,34 +792,23 @@ const RegisterForm = () => {
)} -
- {/* 注册按钮 */} - + {t('注 册')} + +
@@ -865,29 +819,20 @@ const RegisterForm = () => { status.wechat_open_oauth || status.linuxdo_oauth || status.telegram_oauth) && ( -
-
-
-
-
-
- - {t('或')} - -
-
- - +
)} -
+
{t('已有账户?')}{' '} {
{/* 安全提示 */} -
+
{t('安全注册')}
@@ -932,7 +877,7 @@ const RegisterForm = () => { okButtonProps={{ loading: wechatCodeSubmitLoading, }} - className='wechat-login-modal' + className='wechat-login-modal auth-login-modal' > {/* 移动端提示 */} {isMobileView && !isInWeChat && ( @@ -995,7 +940,6 @@ const RegisterForm = () => { onChange={(value) => handleChange('wechat_verification_code', value) } - className='!rounded-xl' /> @@ -1089,7 +1033,7 @@ const RegisterForm = () => { return (
diff --git a/src/components/auth/TwoFAVerification.jsx b/src/components/auth/TwoFAVerification.jsx index 938ce5d1..959f144c 100644 --- a/src/components/auth/TwoFAVerification.jsx +++ b/src/components/auth/TwoFAVerification.jsx @@ -88,7 +88,6 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { value={verificationCode} onChange={setVerificationCode} onKeyPress={handleKeyPress} - size='large' style={{ marginBottom: 16 }} autoFocus /> @@ -98,7 +97,6 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { type='primary' loading={loading} block - size='large' style={{ marginBottom: 16 }} > {t('验证并登录')} @@ -115,7 +113,8 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { setUseBackupCode(!useBackupCode); setVerificationCode(''); }} - style={{ marginRight: 16, color: '#1890ff', padding: 0 }} + style={{ marginRight: 16, padding: 0 }} + className='!text-brand' > {useBackupCode ? t('使用认证器验证码') : t('使用备用码')} @@ -125,7 +124,8 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { theme='borderless' type='tertiary' onClick={onBack} - style={{ color: '#1890ff', padding: 0 }} + style={{ padding: 0 }} + className='!text-brand' > {t('返回登录')} @@ -177,7 +177,6 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { value={verificationCode} onChange={setVerificationCode} onKeyPress={handleKeyPress} - size='large' style={{ marginBottom: 16 }} autoFocus /> @@ -187,7 +186,6 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { type='primary' loading={loading} block - size='large' style={{ marginBottom: 16 }} > {t('验证并登录')} @@ -204,7 +202,8 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { setUseBackupCode(!useBackupCode); setVerificationCode(''); }} - style={{ marginRight: 16, color: '#1890ff', padding: 0 }} + style={{ marginRight: 16, padding: 0 }} + className='!text-brand' > {useBackupCode ? t('使用认证器验证码') : t('使用备用码')} @@ -214,7 +213,8 @@ const TwoFAVerification = ({ onSuccess, onBack, isModal = false }) => { theme='borderless' type='tertiary' onClick={onBack} - style={{ color: '#1890ff', padding: 0 }} + style={{ padding: 0 }} + className='!text-brand' > {t('返回登录')} diff --git a/src/components/layout/PageLayout.jsx b/src/components/layout/PageLayout.jsx index 4bf74090..24c1bd0e 100644 --- a/src/components/layout/PageLayout.jsx +++ b/src/components/layout/PageLayout.jsx @@ -346,9 +346,10 @@ const PageLayout = () => {
{ {selfRegisterEnabled && ( <> -
- - {t('还没有企业?')} - -
+ {t('还没有企业?')} @@ -209,30 +205,19 @@ const OrgRegister = () => { /> ) : ( <> - (formApi.current = api)} onValueChange={(v) => setValues(v)} > { /> { {emailVerifyEnabled && ( { )} -
+
-
- - {t('已有企业?')} - -
+ {t('已有企业?')}