fix(ui): 完善界面交互与开发配置
This commit is contained in:
@@ -166,6 +166,16 @@ const LoginForm = () => {
|
||||
const [githubButtonText, setGithubButtonText] = useState('');
|
||||
const [githubButtonDisabled, setGithubButtonDisabled] = useState(false);
|
||||
const githubTimeoutRef = useRef(null);
|
||||
// 微信验证码弹窗表单:确定前先做前端必填校验,通过后再走原提交逻辑
|
||||
const wechatFormApi = useRef(null);
|
||||
const submitWeChatCodeWithValidation = async () => {
|
||||
try {
|
||||
await wechatFormApi.current?.validate();
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
await onSubmitWeChatVerificationCode();
|
||||
};
|
||||
|
||||
const logo = getLogo();
|
||||
const systemName = getSystemName();
|
||||
@@ -826,14 +836,10 @@ const LoginForm = () => {
|
||||
<Form.Input
|
||||
field='username'
|
||||
className='auth-login-required-field'
|
||||
rules={[{ required: true, message: t('请输入用户名或邮箱') }]}
|
||||
rules={[{ required: true, message: t('请输入用户名/邮箱') }]}
|
||||
required
|
||||
aria-required='true'
|
||||
label={
|
||||
<span className='text-xs font-medium text-gray-600 dark:text-gray-300'>
|
||||
{t('用户名/邮箱')}
|
||||
</span>
|
||||
}
|
||||
label={t('用户名/邮箱')}
|
||||
placeholder={t('请输入用户名或邮箱')}
|
||||
name='username'
|
||||
size='default'
|
||||
@@ -849,11 +855,7 @@ const LoginForm = () => {
|
||||
rules={[{ required: true, message: t('请输入密码') }]}
|
||||
required
|
||||
aria-required='true'
|
||||
label={
|
||||
<span className='text-xs font-medium text-gray-600 dark:text-gray-300'>
|
||||
{t('密码')}
|
||||
</span>
|
||||
}
|
||||
label={t('密码')}
|
||||
placeholder={t('请输入密码')}
|
||||
name='password'
|
||||
mode='password'
|
||||
@@ -864,7 +866,7 @@ const LoginForm = () => {
|
||||
/>
|
||||
|
||||
{(hasUserAgreement || hasPrivacyPolicy) && (
|
||||
<div className='flex items-center'>
|
||||
<div className='auth-login-agree-row flex items-center'>
|
||||
<Checkbox
|
||||
checked={agreedToTerms}
|
||||
onChange={(e) => setAgreedToTerms(e.target.checked)}
|
||||
@@ -987,7 +989,7 @@ const LoginForm = () => {
|
||||
}
|
||||
visible={showWeChatLoginModal}
|
||||
maskClosable={true}
|
||||
onOk={onSubmitWeChatVerificationCode}
|
||||
onOk={submitWeChatCodeWithValidation}
|
||||
onCancel={() => setShowWeChatLoginModal(false)}
|
||||
okText={t('登录')}
|
||||
centered={true}
|
||||
@@ -1048,11 +1050,12 @@ const LoginForm = () => {
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Form>
|
||||
<Form getFormApi={(api) => (wechatFormApi.current = api)}>
|
||||
<Form.Input
|
||||
field='wechat_verification_code'
|
||||
placeholder={t('请输入验证码')}
|
||||
label={t('验证码')}
|
||||
rules={[{ required: true, message: t('请输入验证码') }]}
|
||||
value={inputs.wechat_verification_code}
|
||||
onChange={(value) =>
|
||||
handleChange('wechat_verification_code', value)
|
||||
|
||||
Reference in New Issue
Block a user