增加操作手册

This commit is contained in:
2026-07-02 17:16:23 +08:00
parent d39404f1b7
commit 4a401d101c
4 changed files with 9 additions and 5 deletions
@@ -119,6 +119,7 @@ const AdminSettings: React.FC = () => {
'协议配置': configs.filter(c => c.key === 'user_agreement_privacy_url'), '协议配置': configs.filter(c => c.key === 'user_agreement_privacy_url'),
'SEO 设置': configs.filter(c => c.key.startsWith('seo_')), 'SEO 设置': configs.filter(c => c.key.startsWith('seo_')),
'用户积分配置': configs.filter(c => c.key.startsWith('user_') && c.key.includes('credits')), '用户积分配置': configs.filter(c => c.key.startsWith('user_') && c.key.includes('credits')),
'其他配置': configs.filter(c => c.key === 'operation_manual'),
}; };
const getFieldDescription = (config: SystemConfig): string => { const getFieldDescription = (config: SystemConfig): string => {
@@ -133,6 +134,7 @@ const AdminSettings: React.FC = () => {
user_register_credits: '用户注册时赠送的初始积分,默认100', user_register_credits: '用户注册时赠送的初始积分,默认100',
user_login_credits: '用户每日登录赠送的积分数量', user_login_credits: '用户每日登录赠送的积分数量',
user_login_credits_enabled: '是否启用每日登录赠送积分功能', user_login_credits_enabled: '是否启用每日登录赠送积分功能',
operation_manual: '操作手册链接,前台用户菜单将展示该入口,点击跳转此链接',
}; };
return descMap[config.key] || config.description || ''; return descMap[config.key] || config.description || '';
}; };
+4 -3
View File
@@ -312,12 +312,12 @@ async def get_site_info(db: AsyncSession = Depends(get_db)):
"""Public endpoint returning site name, logo, agreement and copyright info.""" """Public endpoint returning site name, logo, agreement and copyright info."""
result = await db.execute( result = await db.execute(
select(SystemConfig).where(SystemConfig.key.in_([ select(SystemConfig).where(SystemConfig.key.in_([
"site_name", "site_logo", "user_agreement_privacy_url", "site_copyright" "site_name", "site_logo", "user_agreement_privacy_url", "site_copyright", "operation_manual"
])) ]))
) )
configs = result.scalars().all() configs = result.scalars().all()
info = {c.key: c.value for c in configs} info = {c.key: c.value for c in configs}
# Helper function to convert relative path to full URL # Helper function to convert relative path to full URL
def to_full_url(path: str | None) -> str: def to_full_url(path: str | None) -> str:
if not path: if not path:
@@ -328,12 +328,13 @@ async def get_site_info(db: AsyncSession = Depends(get_db)):
# Convert relative path to full URL # Convert relative path to full URL
base_url = settings.BASE_URL.rstrip("/") base_url = settings.BASE_URL.rstrip("/")
return f"{base_url}{path}" return f"{base_url}{path}"
return { return {
"site_name": info.get("site_name", "VideoGen.AI"), "site_name": info.get("site_name", "VideoGen.AI"),
"site_logo": to_full_url(info.get("site_logo")), "site_logo": to_full_url(info.get("site_logo")),
"user_agreement_privacy_url": to_full_url(info.get("user_agreement_privacy_url")), "user_agreement_privacy_url": to_full_url(info.get("user_agreement_privacy_url")),
"site_copyright": info.get("site_copyright", "© 2024 民众智创 版权所有"), "site_copyright": info.get("site_copyright", "© 2024 民众智创 版权所有"),
"operation_manual": info.get("operation_manual", ""),
} }
+2 -2
View File
@@ -174,8 +174,8 @@ export async function verifyCaptcha(captchaId: string, x: number): Promise<strin
return res.token; return res.token;
} }
// ── Site Info ───────────────────────────────────────────── // ── Site Info ─────────────────────────────────────────────
export async function getSiteInfo(): Promise<{ siteName: string; siteLogo: string; userAgreementPrivacyUrl: string; siteCopyright: string }> { export async function getSiteInfo(): Promise<{ siteName: string; siteLogo: string; userAgreementPrivacyUrl: string; siteCopyright: string; operationManual: string }> {
if (USE_MOCK) return { siteName: 'VideoGen.AI', siteLogo: '', userAgreementPrivacyUrl: '', siteCopyright: '© 2024 民众智创 版权所有' }; if (USE_MOCK) return { siteName: 'VideoGen.AI', siteLogo: '', userAgreementPrivacyUrl: '', siteCopyright: '© 2024 民众智创 版权所有', operationManual: '' };
return api.get('/auth/site-info', false); return api.get('/auth/site-info', false);
} }
// ── Video Engines ───────────────────────────────────────── // ── Video Engines ─────────────────────────────────────────
+1
View File
@@ -301,6 +301,7 @@ let MOCK_SYSTEM_CONFIGS: SystemConfig[] = [
{ id: 'sc-3', key: 'seo_title', value: 'VideoGen.AI - AI视频生成平台', description: 'SEO标题' }, { id: 'sc-3', key: 'seo_title', value: 'VideoGen.AI - AI视频生成平台', description: 'SEO标题' },
{ id: 'sc-4', key: 'seo_description', value: '专业的AI视频生成服务,一键将文字转化为精美视频', description: 'SEO描述' }, { id: 'sc-4', key: 'seo_description', value: '专业的AI视频生成服务,一键将文字转化为精美视频', description: 'SEO描述' },
{ id: 'sc-5', key: 'seo_keywords', value: 'AI视频,视频生成,人工智能,AIGC,短视频', description: 'SEO关键词' }, { id: 'sc-5', key: 'seo_keywords', value: 'AI视频,视频生成,人工智能,AIGC,短视频', description: 'SEO关键词' },
{ id: 'sc-6', key: 'operation_manual', value: '', description: '操作手册链接' },
]; ];
const MOCK_ADMIN_NOTIFICATIONS: AdminNotification[] = [ const MOCK_ADMIN_NOTIFICATIONS: AdminNotification[] = [