fix(ui): 完善界面交互与开发配置
This commit is contained in:
@@ -79,6 +79,12 @@ const OrgRegister = () => {
|
||||
};
|
||||
|
||||
const sendCode = async () => {
|
||||
// 先就地校验联系邮箱(必填 + 格式),未通过时由输入框下方提示
|
||||
try {
|
||||
await formApi.current?.validate(['contact_email']);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
const email = (values.contact_email || '').trim();
|
||||
if (!email) {
|
||||
Toast.warning(t('请先输入联系邮箱'));
|
||||
@@ -224,7 +230,7 @@ const OrgRegister = () => {
|
||||
'登录企业空间使用的管理员账号名,注册后不可修改;请勿使用 admin、root 等通用名',
|
||||
)}
|
||||
rules={[
|
||||
{ required: true, message: t('请设置管理员登录名') },
|
||||
{ required: true, message: t('请输入管理员登录名') },
|
||||
{
|
||||
pattern: LOGIN_NAME_PATTERN,
|
||||
message: t(
|
||||
@@ -251,11 +257,18 @@ const OrgRegister = () => {
|
||||
field='contact_email'
|
||||
label={t('联系邮箱')}
|
||||
placeholder={t('用于接收通知')}
|
||||
rules={
|
||||
emailVerifyEnabled
|
||||
rules={[
|
||||
...(emailVerifyEnabled
|
||||
? [{ required: true, message: t('请输入联系邮箱') }]
|
||||
: []
|
||||
}
|
||||
: []),
|
||||
// 格式校验:选填时为空不报错,有值时需为合法邮箱
|
||||
{
|
||||
type: 'email',
|
||||
transform: (v) => v?.trim(),
|
||||
message: t('邮箱格式不正确'),
|
||||
},
|
||||
]}
|
||||
trigger='blur'
|
||||
suffix={
|
||||
emailVerifyEnabled ? (
|
||||
<Button
|
||||
@@ -276,7 +289,7 @@ const OrgRegister = () => {
|
||||
field='verify_code'
|
||||
label={t('邮箱验证码')}
|
||||
placeholder={t('请输入验证码')}
|
||||
rules={[{ required: true, message: t('请输入验证码') }]}
|
||||
rules={[{ required: true, message: t('请输入邮箱验证码') }]}
|
||||
/>
|
||||
)}
|
||||
<Form.Input
|
||||
|
||||
Reference in New Issue
Block a user