1
This commit is contained in:
@@ -361,7 +361,7 @@ export async function adminChangePassword(oldPwd: string, newPwd: string): Promi
|
||||
await api.post('/admin/change-password', { old_password: oldPwd, new_password: newPwd });
|
||||
}
|
||||
|
||||
export async function getSiteInfo(): Promise<{ siteName: string; siteLogo: string; userAgreementPrivacyUrl: string; siteCopyright: string }> {
|
||||
export async function getSiteInfo(): Promise<{ siteName: string; siteLogo: string; userAgreementUrl: string; privacyPolicyUrl: string }> {
|
||||
return api.get('/auth/site-info', false);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,9 +84,8 @@ const AdminSettings: React.FC = () => {
|
||||
};
|
||||
|
||||
const groupedConfigs: Record<string, SystemConfig[]> = {
|
||||
'站点信息': configs.filter(c => c.key.startsWith('site_') && c.key !== 'site_copyright'),
|
||||
'协议配置': configs.filter(c => c.key === 'user_agreement_privacy_url'),
|
||||
'版权信息': configs.filter(c => c.key === 'site_copyright'),
|
||||
'站点信息': configs.filter(c => c.key.startsWith('site_')),
|
||||
'协议配置': configs.filter(c => c.key === 'user_agreement_url' || c.key === 'privacy_policy_url'),
|
||||
'SEO 设置': configs.filter(c => c.key.startsWith('seo_')),
|
||||
'用户积分配置': configs.filter(c => c.key.startsWith('user_') && c.key.includes('credits')),
|
||||
};
|
||||
@@ -95,8 +94,8 @@ const AdminSettings: React.FC = () => {
|
||||
const descMap: Record<string, string> = {
|
||||
site_name: '平台显示名称,将展示在页面标题和导航栏',
|
||||
site_logo: '平台Logo图片URL,建议尺寸 200x40px',
|
||||
user_agreement_privacy_url: '用户注册/登录时需同意的用户协议及隐私政策PDF文件',
|
||||
site_copyright: '网站底部显示的版权信息,例如:© 2024 民众智创 版权所有',
|
||||
user_agreement_url: '用户注册/登录时需同意的用户协议PDF文件',
|
||||
privacy_policy_url: '用户注册/登录时需同意的隐私政策PDF文件',
|
||||
seo_title: '搜索引擎结果中显示的标题',
|
||||
seo_description: '搜索引擎结果中显示的描述文字,建议150字以内',
|
||||
seo_keywords: '用逗号分隔的关键词列表',
|
||||
@@ -199,7 +198,7 @@ const AdminSettings: React.FC = () => {
|
||||
};
|
||||
|
||||
const PdfUploadField: React.FC<{ config: SystemConfig }> = ({ config }) => {
|
||||
const label = '用户协议及隐私政策';
|
||||
const label = config.key === 'user_agreement_url' ? '用户协议' : '隐私政策';
|
||||
const hasFile = config.value && config.value.startsWith('/uploads/');
|
||||
return (
|
||||
<div style={{
|
||||
|
||||
@@ -1076,8 +1076,7 @@ async def list_system_configs(
|
||||
admin: User = Depends(get_admin_user),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
):
|
||||
deprecated_keys = {"user_agreement_url", "privacy_policy_url"}
|
||||
result = await db.execute(select(SystemConfig).where(~SystemConfig.key.in_(deprecated_keys)))
|
||||
result = await db.execute(select(SystemConfig))
|
||||
return result.scalars().all()
|
||||
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ async def get_site_info(db: AsyncSession = Depends(get_db)):
|
||||
"""Public endpoint returning site name and logo."""
|
||||
result = await db.execute(
|
||||
select(SystemConfig).where(SystemConfig.key.in_([
|
||||
"site_name", "site_logo", "user_agreement_privacy_url", "site_copyright"
|
||||
"site_name", "site_logo", "user_agreement_url", "privacy_policy_url"
|
||||
]))
|
||||
)
|
||||
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_privacy_url": to_full_url(info.get("user_agreement_privacy_url")),
|
||||
"site_copyright": info.get("site_copyright", ""),
|
||||
"user_agreement_url": to_full_url(info.get("user_agreement_url")),
|
||||
"privacy_policy_url": to_full_url(info.get("privacy_policy_url")),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -168,8 +168,8 @@ async def _seed_data():
|
||||
("seo_description", "专业的AI视频生成服务", "SEO描述"),
|
||||
("seo_keywords", "AI视频,视频生成,人工智能", "SEO关键词"),
|
||||
# Agreement configs
|
||||
("user_agreement_privacy_url", "", "用户协议及隐私政策PDF"),
|
||||
("site_copyright", "", "网站底部版权信息"),
|
||||
("user_agreement_url", "", "用户协议PDF"),
|
||||
("privacy_policy_url", "", "隐私政策PDF"),
|
||||
# Payment configs
|
||||
("payment_wechat_enabled", "false", "微信支付启用"),
|
||||
("payment_wechat_mch_id", "", "微信商户号"),
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -28,8 +28,8 @@
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-B8YRCuP0.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DQMklOkA.css">
|
||||
<script type="module" crossorigin src="/assets/index-BHOoZIhk.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-xCZbcxht.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -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; userAgreementPrivacyUrl: string; siteCopyright: string }> {
|
||||
if (USE_MOCK) return { siteName: 'VideoGen.AI', siteLogo: '', userAgreementPrivacyUrl: '', siteCopyright: '' };
|
||||
export async function getSiteInfo(): Promise<{ siteName: string; siteLogo: string; userAgreementUrl: string; privacyPolicyUrl: string }> {
|
||||
if (USE_MOCK) return { siteName: 'VideoGen.AI', siteLogo: '', userAgreementUrl: '', privacyPolicyUrl: '' };
|
||||
return api.get('/auth/site-info', false);
|
||||
}
|
||||
// ── Video Engines ─────────────────────────────────────────
|
||||
|
||||
@@ -375,18 +375,3 @@
|
||||
font-size: 15px !important;
|
||||
}
|
||||
}
|
||||
|
||||
.login-copyright {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.login-copyright-text {
|
||||
font-size: 12px !important;
|
||||
color: #94a3b8 !important;
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.login-copyright-text {
|
||||
font-size: 11px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ const LoginPage: React.FC = () => {
|
||||
const initialInfo = getInitialSiteInfo();
|
||||
const [siteName, setSiteName] = useState(initialInfo.siteName);
|
||||
const [siteLogo, setSiteLogo] = useState(initialInfo.siteLogo);
|
||||
const [agreementPrivacyUrl, setAgreementPrivacyUrl] = useState('');
|
||||
const [siteCopyright, setSiteCopyright] = useState('');
|
||||
const [agreementUrl, setAgreementUrl] = useState('');
|
||||
const [policyUrl, setPolicyUrl] = useState('');
|
||||
|
||||
const navigate = useNavigate();
|
||||
const { login } = useAuthStore();
|
||||
@@ -57,14 +57,14 @@ const LoginPage: React.FC = () => {
|
||||
getSiteInfo().then(info => {
|
||||
setSiteName(info.siteName);
|
||||
setSiteLogo(info.siteLogo);
|
||||
setAgreementPrivacyUrl(info.userAgreementPrivacyUrl);
|
||||
setSiteCopyright(info.siteCopyright);
|
||||
setAgreementUrl(info.userAgreementUrl);
|
||||
setPolicyUrl(info.privacyPolicyUrl);
|
||||
}).catch(() => {});
|
||||
}, []);
|
||||
|
||||
const checkAgreed = (): boolean => {
|
||||
if (!agreed) {
|
||||
message.warning('请先阅读并同意用户协议及隐私政策');
|
||||
message.warning('请先阅读并同意用户协议和隐私政策');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -440,9 +440,14 @@ const LoginPage: React.FC = () => {
|
||||
<span className="login-agreement-text">
|
||||
我已阅读并同意
|
||||
<span
|
||||
onClick={e => { e.stopPropagation(); openPdf(agreementPrivacyUrl); }}
|
||||
onClick={e => { e.stopPropagation(); openPdf(agreementUrl); }}
|
||||
className="login-link"
|
||||
>《用户协议及隐私政策》</span>
|
||||
>《用户协议》</span>
|
||||
和
|
||||
<span
|
||||
onClick={e => { e.stopPropagation(); openPdf(policyUrl); }}
|
||||
className="login-link"
|
||||
>《隐私政策》</span>
|
||||
</span>
|
||||
</Checkbox>
|
||||
</div>
|
||||
@@ -481,12 +486,6 @@ const LoginPage: React.FC = () => {
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
{siteCopyright && (
|
||||
<div className="login-copyright">
|
||||
<Typography.Text className="login-copyright-text">{siteCopyright}</Typography.Text>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user