|
|
|
@@ -129,6 +129,15 @@ export default function SettingsHeaderNavModules(props) { |
|
|
|
|
|
|
|
// 保存配置 |
|
|
|
async function onSubmit() { |
|
|
|
const customLinkText = (headerNavModules.customLink?.text || '').trim(); |
|
|
|
const customLinkUrl = (headerNavModules.customLink?.url || '').trim(); |
|
|
|
if ( |
|
|
|
headerNavModules.customLink?.enabled && |
|
|
|
(!customLinkText || !customLinkUrl) |
|
|
|
) { |
|
|
|
showError(t('启用自定义链接前请先填写完整的导航文案和跳转链接')); |
|
|
|
return; |
|
|
|
} |
|
|
|
setLoading(true); |
|
|
|
try { |
|
|
|
const res = await API.put('/api/option/', { |
|
|
|
@@ -410,6 +419,19 @@ export default function SettingsHeaderNavModules(props) { |
|
|
|
placeholder={t('如 https://example.com 或 /docs')} |
|
|
|
size='small' |
|
|
|
/> |
|
|
|
<Text |
|
|
|
type='tertiary' |
|
|
|
size='small' |
|
|
|
style={{ |
|
|
|
fontSize: '11px', |
|
|
|
color: 'var(--semi-color-text-2)', |
|
|
|
lineHeight: '1.4', |
|
|
|
display: 'block', |
|
|
|
marginTop: '4px', |
|
|
|
}} |
|
|
|
> |
|
|
|
{t('未填写跳转链接时,自定义链接不会在前台显示')} |
|
|
|
</Text> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
)} |
|
|
|
|