This commit is contained in:
parent
e3aa52af01
commit
56a955ae81
@ -0,0 +1,16 @@
|
|||||||
|
我已找到导致页面显示异常的两个主要原因:
|
||||||
|
|
||||||
|
1. **标签值重复**:“到期通知”的内容区域错误地使用了 `value='verify'`(与“验证邮件”重复),导致点击标签时无法正确匹配。
|
||||||
|
2. **强制渲染属性**:部分标签页使用了 `forceMount` 属性,导致内容即使未被选中也保留在页面上。由于表单已配置 `shouldUnregister: false`,我们可以安全地移除该属性,让未选中的标签页自动隐藏。
|
||||||
|
|
||||||
|
**修改计划:**
|
||||||
|
|
||||||
|
编辑 `apps/admin/app/dashboard/auth-control/forms/email-settings-form.tsx` 文件:
|
||||||
|
|
||||||
|
1. **修正标签关联**:将第 474 行的 `value='verify'` 修改为 `value='expiration'`。
|
||||||
|
2. **优化显示逻辑**:移除以下位置的 `forceMount` 属性,确保只有当前选中的标签页才会显示:
|
||||||
|
- SMTP 设置 (第 260 行)
|
||||||
|
- 到期通知 (第 474 行)
|
||||||
|
- 维护通知 (第 519 行)
|
||||||
|
|
||||||
|
这样修改后,点击对应的标签将只显示对应的内容,且“全部显示”的问题将得到解决。
|
||||||
@ -87,6 +87,7 @@ export default function EmailSettingsForm() {
|
|||||||
|
|
||||||
const form = useForm<EmailSettingsFormData>({
|
const form = useForm<EmailSettingsFormData>({
|
||||||
resolver: zodResolver(emailSettingsSchema),
|
resolver: zodResolver(emailSettingsSchema),
|
||||||
|
shouldUnregister: false,
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
id: 0,
|
id: 0,
|
||||||
method: 'email',
|
method: 'email',
|
||||||
@ -416,8 +417,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
@ -480,8 +481,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
@ -525,8 +526,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
@ -580,8 +581,8 @@ export default function EmailSettingsForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<HTMLEditor
|
<HTMLEditor
|
||||||
placeholder={t('email.inputPlaceholder')}
|
placeholder={t('email.inputPlaceholder')}
|
||||||
value={field.value}
|
value={field.value ?? ''}
|
||||||
onBlur={field.onChange}
|
onChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<div className='mt-4 space-y-2 border-t pt-4'>
|
<div className='mt-4 space-y-2 border-t pt-4'>
|
||||||
|
|||||||
@ -302,6 +302,25 @@ export default function Page() {
|
|||||||
header: t('inviteCode'),
|
header: t('inviteCode'),
|
||||||
cell: ({ row }) => row.getValue('refer_code') || '--',
|
cell: ({ row }) => row.getValue('refer_code') || '--',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'last_login_time',
|
||||||
|
header: '最后登录时间',
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const v = (row.original as any)?.last_login_time;
|
||||||
|
if (!v) return '---';
|
||||||
|
const ts = Number(v);
|
||||||
|
const ms = ts < 1e12 ? ts * 1000 : ts;
|
||||||
|
return formatDate(ms) as any;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'member_status',
|
||||||
|
header: '会员状态',
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const v = (row.original as any)?.member_status;
|
||||||
|
return <span className='text-sm'>{v ?? '---'}</span>;
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'referer_id',
|
accessorKey: 'referer_id',
|
||||||
header: t('referer'),
|
header: t('referer'),
|
||||||
|
|||||||
@ -35,16 +35,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Set up pre-commit hook
|
# Set up pre-commit hook
|
||||||
setup_husky_hook "pre-commit" "#!/bin/sh
|
setup_husky_hook "pre-commit" "npx --no-install lint-staged"
|
||||||
. \"\$(dirname \"\$0\")/_/husky.sh\"
|
|
||||||
|
|
||||||
npx --no-install lint-staged"
|
|
||||||
|
|
||||||
# Set up commit-msg hook
|
# Set up commit-msg hook
|
||||||
setup_husky_hook "commit-msg" "#!/bin/sh
|
setup_husky_hook "commit-msg" "npx --no-install commitlint --edit \"\$1\""
|
||||||
. \"\$(dirname \"\$0\")/_/husky.sh\"
|
|
||||||
|
|
||||||
npx --no-install commitlint --edit \"\$1\""
|
|
||||||
|
|
||||||
# Function to globally install an npm package if not installed
|
# Function to globally install an npm package if not installed
|
||||||
install_global_package() {
|
install_global_package() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user