This commit is contained in:
2026-06-29 11:26:14 +08:00
parent 43d12894c1
commit 9dd1bcdefc
11 changed files with 40 additions and 31 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -28,7 +28,7 @@
}
})();
</script>
<script type="module" crossorigin src="/assets/index-DSXie0ty.js"></script>
<script type="module" crossorigin src="/assets/index-D-PZ2I17.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
</head>
<body>
+4 -4
View File
@@ -85,7 +85,7 @@ const AdminSettings: React.FC = () => {
const groupedConfigs: Record<string, SystemConfig[]> = {
'站点信息': configs.filter(c => c.key.startsWith('site_')),
'协议配置': configs.filter(c => c.key === 'user_agreement_url' || c.key === 'privacy_policy_url'),
'协议配置': configs.filter(c => c.key === 'user_agreement_privacy_url'),
'SEO 设置': configs.filter(c => c.key.startsWith('seo_')),
'用户积分配置': configs.filter(c => c.key.startsWith('user_') && c.key.includes('credits')),
};
@@ -94,8 +94,8 @@ const AdminSettings: React.FC = () => {
const descMap: Record<string, string> = {
site_name: '平台显示名称,将展示在页面标题和导航栏',
site_logo: '平台Logo图片URL,建议尺寸 200x40px',
user_agreement_url: '用户注册/登录时需同意的用户协议PDF文件',
privacy_policy_url: '用户注册/登录时需同意的隐私政策PDF文件',
site_copyright: '显示在前台登录页底部的版权信息,例如:© 2024 民众智创 版权所有',
user_agreement_privacy_url: '用户登录时需同意的用户协议及隐私政策PDF文件',
seo_title: '搜索引擎结果中显示的标题',
seo_description: '搜索引擎结果中显示的描述文字,建议150字以内',
seo_keywords: '用逗号分隔的关键词列表',
@@ -198,7 +198,7 @@ const AdminSettings: React.FC = () => {
};
const PdfUploadField: React.FC<{ config: SystemConfig }> = ({ config }) => {
const label = config.key === 'user_agreement_url' ? '用户协议' : '隐私政策';
const label = config.key === 'user_agreement_privacy_url' ? '用户协议及隐私政策' : '协议文件';
const hasFile = config.value && config.value.startsWith('/uploads/');
return (
<div style={{
+4 -4
View File
@@ -301,10 +301,10 @@ async def change_password(
@router.get("/site-info")
async def get_site_info(db: AsyncSession = Depends(get_db)):
"""Public endpoint returning site name and logo."""
"""Public endpoint returning site name, logo, agreement and copyright info."""
result = await db.execute(
select(SystemConfig).where(SystemConfig.key.in_([
"site_name", "site_logo", "user_agreement_url", "privacy_policy_url"
"site_name", "site_logo", "user_agreement_privacy_url", "site_copyright"
]))
)
configs = result.scalars().all()
@@ -324,8 +324,8 @@ async def get_site_info(db: AsyncSession = Depends(get_db)):
return {
"site_name": info.get("site_name", "VideoGen.AI"),
"site_logo": to_full_url(info.get("site_logo")),
"user_agreement_url": to_full_url(info.get("user_agreement_url")),
"privacy_policy_url": to_full_url(info.get("privacy_policy_url")),
"user_agreement_privacy_url": to_full_url(info.get("user_agreement_privacy_url")),
"site_copyright": info.get("site_copyright", "© 2024 民众智创 版权所有"),
}
+3 -3
View File
@@ -164,12 +164,12 @@ async def _seed_data():
configs = [
("site_name", "民众智创", "网站名称"),
("site_logo", "", "网站Logo URL"),
("site_copyright", "© 2024 民众智创 版权所有", "网站底部版权信息"),
("seo_title", "民众智创 - AI视频生成平台", "SEO标题"),
("seo_description", "专业的AI视频生成服务", "SEO描述"),
("seo_keywords", "AI视频,视频生成,人工智能", "SEO关键词"),
# Agreement configs
("user_agreement_url", "", "用户协议PDF"),
("privacy_policy_url", "", "隐私政策PDF"),
# Agreement config
("user_agreement_privacy_url", "", "用户协议及隐私政策PDF"),
# Payment configs
("payment_wechat_enabled", "false", "微信支付启用"),
("payment_wechat_mch_id", "", "微信商户号"),
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -28,8 +28,8 @@
}
})();
</script>
<script type="module" crossorigin src="/assets/index-BHOoZIhk.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-xCZbcxht.css">
<script type="module" crossorigin src="/assets/index-DsdPVJNu.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DGXGZx3k.css">
</head>
<body>
<div id="root"></div>
+2 -2
View File
@@ -174,8 +174,8 @@ export async function verifyCaptcha(captchaId: string, x: number): Promise<strin
return res.token;
}
// ── Site Info ─────────────────────────────────────────────
export async function getSiteInfo(): Promise<{ siteName: string; siteLogo: string; userAgreementUrl: string; privacyPolicyUrl: string }> {
if (USE_MOCK) return { siteName: 'VideoGen.AI', siteLogo: '', userAgreementUrl: '', privacyPolicyUrl: '' };
export async function getSiteInfo(): Promise<{ siteName: string; siteLogo: string; userAgreementPrivacyUrl: string; siteCopyright: string }> {
if (USE_MOCK) return { siteName: 'VideoGen.AI', siteLogo: '', userAgreementPrivacyUrl: '', siteCopyright: '© 2024 民众智创 版权所有' };
return api.get('/auth/site-info', false);
}
// ── Video Engines ─────────────────────────────────────────
+9
View File
@@ -180,12 +180,21 @@
.login-right-section {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 1;
padding: 16px 16px 32px;
}
.login-copyright {
margin-top: 16px;
text-align: center;
color: rgba(255,255,255,0.7);
font-size: 12px;
letter-spacing: 0.5px;
}
@media (min-width: 900px) {
.login-right-section {
padding: 40px 24px;
+12 -12
View File
@@ -44,8 +44,8 @@ const LoginPage: React.FC = () => {
const initialInfo = getInitialSiteInfo();
const [siteName, setSiteName] = useState(initialInfo.siteName);
const [siteLogo, setSiteLogo] = useState(initialInfo.siteLogo);
const [agreementUrl, setAgreementUrl] = useState('');
const [policyUrl, setPolicyUrl] = useState('');
const [agreementPrivacyUrl, setAgreementPrivacyUrl] = useState('');
const [siteCopyright, setSiteCopyright] = useState('© 2024 民众智创 版权所有');
const navigate = useNavigate();
const { login } = useAuthStore();
@@ -57,14 +57,14 @@ const LoginPage: React.FC = () => {
getSiteInfo().then(info => {
setSiteName(info.siteName);
setSiteLogo(info.siteLogo);
setAgreementUrl(info.userAgreementUrl);
setPolicyUrl(info.privacyPolicyUrl);
setAgreementPrivacyUrl(info.userAgreementPrivacyUrl);
setSiteCopyright(info.siteCopyright || '© 2024 民众智创 版权所有');
}).catch(() => {});
}, []);
const checkAgreed = (): boolean => {
if (!agreed) {
message.warning('请先阅读并同意用户协议隐私政策');
message.warning('请先阅读并同意用户协议隐私政策');
return false;
}
return true;
@@ -440,14 +440,9 @@ const LoginPage: React.FC = () => {
<span className="login-agreement-text">
<span
onClick={e => { e.stopPropagation(); openPdf(agreementUrl); }}
onClick={e => { e.stopPropagation(); openPdf(agreementPrivacyUrl); }}
className="login-link"
></span>
<span
onClick={e => { e.stopPropagation(); openPdf(policyUrl); }}
className="login-link"
></span>
></span>
</span>
</Checkbox>
</div>
@@ -486,6 +481,11 @@ const LoginPage: React.FC = () => {
)}
</div>
</Card>
{siteCopyright && (
<div className="login-copyright">
{siteCopyright}
</div>
)}
</div>
</div>
);