Merge branch 'main' of https://gitee.com/wg123/video-gen
This commit is contained in:
@@ -7,7 +7,7 @@ import AdminAuthoriz from './pages/AdminAuthoriz';
|
||||
import AdminConsume from './pages/AdminConsume';
|
||||
import AdminLoginPage from './pages/AdminLoginPage';
|
||||
import AdminDashboard from './pages/AdminDashboard';
|
||||
import AdminPlatform from './pages/AdminPlatform';
|
||||
import AdminPlatform from './pages/Adminplatform';
|
||||
import AdminUsers from './pages/AdminUsers';
|
||||
import AdminModels from './pages/AdminModels';
|
||||
import AdminSettings from './pages/AdminSettings';
|
||||
|
||||
@@ -83,7 +83,14 @@ const AdminSettings: React.FC = () => {
|
||||
const res = await uploadPdf(file, configKey);
|
||||
setConfigs(prev => prev.map(c => c.key === configKey ? { ...c, value: res.url } : c));
|
||||
form.setFieldsValue({ [configKey]: res.url });
|
||||
message.success('PDF上传成功');
|
||||
|
||||
// Find the config and update to database
|
||||
const config = configs.find(c => c.key === configKey);
|
||||
if (config) {
|
||||
await updateSystemConfig(config.id, res.url);
|
||||
}
|
||||
|
||||
message.success('PDF上传成功并已保存');
|
||||
} catch {
|
||||
message.error('上传失败');
|
||||
} finally {
|
||||
@@ -109,7 +116,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')),
|
||||
};
|
||||
@@ -118,8 +125,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: '用逗号分隔的关键词列表',
|
||||
@@ -196,7 +203,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/');
|
||||
const baseUrl = import.meta.env.VITE_API_BASE || 'http://localhost:8000';
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user