
-
👋 Liu 宇阳
-
🎯 梦想做一名技术顶尖的架构师,奈何学历太低!
+
{theme.record_name}
+
{theme.record_info}
diff --git a/src/components/ArticleLayout/Classics/index.tsx b/src/components/ArticleLayout/Classics/index.tsx
index 823aba6..1b29d08 100644
--- a/src/components/ArticleLayout/Classics/index.tsx
+++ b/src/components/ArticleLayout/Classics/index.tsx
@@ -9,7 +9,7 @@ import { GoTag } from "react-icons/go";
import Empty from '@/components/Empty';
import Show from '@/components/Show';
-import { getConfigDataAPI } from '@/api/project'
+import { getThemeDataAPI } from '@/api/project'
import { Theme } from '@/types/app/project';
interface ClassicsProps {
@@ -17,7 +17,7 @@ interface ClassicsProps {
}
const Classics = async ({ data }: ClassicsProps) => {
- const { data: theme } = await getConfigDataAPI("layout") || { data: {} as Theme }
+ const { data: theme } = await getThemeDataAPI("layout") || { data: {} as Theme }
const covers = JSON.parse(theme.covers || '[]')
diff --git a/src/components/ArticleLayout/index.tsx b/src/components/ArticleLayout/index.tsx
index c89a3f3..485e019 100644
--- a/src/components/ArticleLayout/index.tsx
+++ b/src/components/ArticleLayout/index.tsx
@@ -2,12 +2,12 @@ import { getArticlePagingAPI } from '@/api/article'
import Pagination from "../Pagination"
import Classics from "./Classics"
import Waterfall from "./Waterfall"
-import { getConfigDataAPI } from '@/api/project'
+import { getThemeDataAPI } from '@/api/project'
import { Theme } from '@/types/app/project'
import { Article } from '@/types/app/article'
export default async ({ page }: { page: number }) => {
- const { data: theme } = await getConfigDataAPI("layout") || { data: {} as Theme }
+ const { data: theme } = await getThemeDataAPI("layout") || { data: {} as Theme }
const sidebar: string[] = JSON.parse(theme?.right_sidebar)
// 如果是瀑布流布局就显示28条数据,否则显示8条
diff --git a/src/components/Footer/index.tsx b/src/components/Footer/index.tsx
index ac53a20..7208b08 100644
--- a/src/components/Footer/index.tsx
+++ b/src/components/Footer/index.tsx
@@ -1,13 +1,13 @@
import Link from 'next/link';
import { Tooltip } from '@nextui-org/react';
-import { getConfigDataAPI } from '@/api/project';
+import { getThemeDataAPI } from '@/api/project';
import { getUserDataAPI } from '@/api/user';
import { User } from '@/types/app/user';
import { Web } from '@/types/app/project';
export default async () => {
const { data: { avatar } } = await getUserDataAPI() || { data: {} as User }
- const { data: { footer } } = await getConfigDataAPI("web") || { data: {} as Web }
+ const { data: { footer } } = await getThemeDataAPI("web") || { data: {} as Web }
return (
<>
diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx
index 3fff81d..b24a0ae 100644
--- a/src/components/Header/index.tsx
+++ b/src/components/Header/index.tsx
@@ -14,7 +14,7 @@ import { BsFillMoonStarsFill, BsTextIndentLeft } from "react-icons/bs";
import { Cate } from '@/types/app/cate';
import { getCateListAPI } from '@/api/cate';
-import { getConfigDataAPI } from '@/api/project';
+import { getThemeDataAPI } from '@/api/project';
import { useConfigStore } from '@/stores';
import { Theme, Web } from '@/types/app/project';
@@ -25,10 +25,10 @@ const Header = () => {
// 获取项目配置
const getConfigData = async () => {
- const { data: web } = await getConfigDataAPI("web") || { data: {} as Web };
+ const { data: web } = await getThemeDataAPI("web") || { data: {} as Web };
setWeb(web)
- const { data: theme } = await getConfigDataAPI("layout") || { data: {} as Theme };
+ const { data: theme } = await getThemeDataAPI("layout") || { data: {} as Theme };
setTheme(theme)
}
diff --git a/src/components/Sidebar/Author/index.tsx b/src/components/Sidebar/Author/index.tsx
index bb94bbb..b24ab31 100644
--- a/src/components/Sidebar/Author/index.tsx
+++ b/src/components/Sidebar/Author/index.tsx
@@ -11,14 +11,14 @@ import QQ from '@/assets/svg/socializing/QQ.svg'
import Weixin from '@/assets/svg/socializing/Weixin.svg'
import { getUserDataAPI } from '@/api/user';
-import { getConfigDataAPI } from '@/api/project'
+import { getThemeDataAPI } from '@/api/project'
import './index.scss';
import { User } from '@/types/app/user';
const Author = async () => {
const { data: user } = await getUserDataAPI() || { data: {} as User }
- const { data: { social } } = await getConfigDataAPI("layout") || { data: {} as Theme }
+ const { data: { social } } = await getThemeDataAPI("layout") || { data: {} as Theme }
const socialList = JSON.parse(social)?.map((item: string) => item)
diff --git a/src/components/Sidebar/HotArticle/index.tsx b/src/components/Sidebar/HotArticle/index.tsx
index 9163944..5c4c0a2 100644
--- a/src/components/Sidebar/HotArticle/index.tsx
+++ b/src/components/Sidebar/HotArticle/index.tsx
@@ -1,6 +1,6 @@
import Link from 'next/link';
import Image from 'next/image';
-import { getConfigDataAPI } from '@/api/project'
+import { getThemeDataAPI } from '@/api/project'
import { getArticleListAPI } from '@/api/article';
import { IoIosArrowForward } from "react-icons/io";
import fire from '@/assets/svg/other/fire.svg';
@@ -9,7 +9,7 @@ import { Theme } from '@/types/app/project';
import { Article } from '@/types/app/article';
const RandomArticle = async () => {
- const { data: theme } = await getConfigDataAPI("layout") || { data: {} as Theme }
+ const { data: theme } = await getThemeDataAPI("layout") || { data: {} as Theme }
const { data: article } = await getArticleListAPI() || { data: [] as Article[] }
const ids = JSON.parse(theme.reco_article ? theme.reco_article : '[]')
diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx
index 211ee38..b3b6aec 100644
--- a/src/components/Sidebar/index.tsx
+++ b/src/components/Sidebar/index.tsx
@@ -2,11 +2,11 @@ import Author from "./Author"
import HotArticle from "./HotArticle"
import RandomArticle from "./RandomArticle"
import Comment from "./Comment"
-import { getConfigDataAPI } from '@/api/project'
+import { getThemeDataAPI } from '@/api/project'
import { Theme } from "@/types/app/project"
export default async () => {
- const { data: theme } = await getConfigDataAPI("layout") || { data: {} as Theme }
+ const { data: theme } = await getThemeDataAPI("layout") || { data: {} as Theme }
const sidebar: string[] = JSON.parse(theme?.right_sidebar)
return (
diff --git a/src/components/Swiper/index.tsx b/src/components/Swiper/index.tsx
index 2a17e34..d97dcb5 100644
--- a/src/components/Swiper/index.tsx
+++ b/src/components/Swiper/index.tsx
@@ -1,7 +1,7 @@
import { ReactNode } from 'react'
import Ripple from '@/components/Ripple'
import { getRandom } from '@/utils'
-import { getConfigDataAPI } from '@/api/project'
+import { getThemeDataAPI } from '@/api/project'
import { Theme } from '@/types/app/project'
interface Props {
@@ -11,7 +11,7 @@ interface Props {
}
export default async ({ src, isRipple = true, children }: Props) => {
- const { data } = await getConfigDataAPI("layout") || { data: {} as Theme }
+ const { data } = await getThemeDataAPI("layout") || { data: {} as Theme }
const covers = JSON.parse(data.covers || '[]')
const sty = {
diff --git a/src/types/app/project.d.ts b/src/types/app/project.d.ts
index 89aee0a..de12f32 100644
--- a/src/types/app/project.d.ts
+++ b/src/types/app/project.d.ts
@@ -36,7 +36,9 @@ export interface Theme {
swiper_text: string,
reco_article: string,
social: string,
- covers: string
+ covers: string,
+ record_name: string,
+ record_info: string
}
// 其他配置