diff --git a/src/api/Project.ts b/src/api/Project.ts index 83f1327..333b593 100644 --- a/src/api/Project.ts +++ b/src/api/Project.ts @@ -12,6 +12,8 @@ export const editWebDataAPI = (data: Web) => Request("PATCH", "/project/web // 获取主题配置信息 export const getThemeDataAPI = () => Request("GET", "/project/theme") +// export const getThemeDataAPI = () => Request("GET", "/project/layout") // 修改主题配置信息 -export const editThemeDataAPI = (data: Theme) => Request("PATCH", "/project/theme", { data }) \ No newline at end of file +export const editThemeDataAPI = (data: Theme) => Request("PATCH", "/project/theme", { data }) +// export const editThemeDataAPI = (data: Theme) => Request("PATCH", "/project/layout", { data }) \ No newline at end of file diff --git a/src/pages/Setup/components/Theme/index.tsx b/src/pages/Setup/components/Theme/index.tsx index a539c33..0c25e91 100644 --- a/src/pages/Setup/components/Theme/index.tsx +++ b/src/pages/Setup/components/Theme/index.tsx @@ -7,8 +7,10 @@ import FileUpload from '@/components/FileUpload'; const ThemePage = () => { const [loading, setLoading] = useState(false); - const [swiperText, setSwiperText] = useState(''); const [isModalOpen, setIsModalOpen] = useState(false); + const [swiperText, setSwiperText] = useState(''); + const [social, setSocial] = useState(''); + const [cover, setCover] = useState(''); const [theme, setTheme] = useState({} as Theme); const onSidebar = (value: string) => { @@ -25,6 +27,9 @@ const ThemePage = () => { const swiperText = JSON.parse(data.swiperText) setSwiperText(swiperText.join('\n')); + + setSocial(JSON.parse(data.social).join("\n")); + setCover(JSON.parse(data.covers).join("\n")); setLoading(false); }; @@ -34,7 +39,14 @@ const ThemePage = () => { const editLayoutData = async () => { setLoading(true); - const updatedLayout = { ...theme, swiperText: JSON.stringify(swiperText.split('\n')) }; + + const updatedLayout = { + ...theme, + swiperText: JSON.stringify(swiperText.split('\n')), + social: JSON.stringify(social.split('\n')), + covers: JSON.stringify(cover.split('\n')) + }; + await editThemeDataAPI(updatedLayout); notification.success({ message: '成功', @@ -84,6 +96,28 @@ const ThemePage = () => { + 社交网站 +
+ setSocial(e.target.value)} + autoSize={{ minRows: 2, maxRows: 4 }} + size='large' + /> + +
+ + 文章随机封面 +
+ setCover(e.target.value)} + autoSize={{ minRows: 2, maxRows: 4 }} + size='large' + /> + +
+ 侧边栏
@@ -128,4 +162,4 @@ const ThemePage = () => { ); }; -export default ThemePage; +export default ThemePage; \ No newline at end of file diff --git a/src/pages/Setup/components/Web/index.tsx b/src/pages/Setup/components/Web/index.tsx index 4e06420..e9e59c4 100644 --- a/src/pages/Setup/components/Web/index.tsx +++ b/src/pages/Setup/components/Web/index.tsx @@ -97,7 +97,7 @@ const WebPage = () => { - { autoSize={{ minRows: 2, maxRows: 10 }} placeholder="社交账号" /> - + */}