From e2b6bd5a829ee00ddb044e4fa54ac5c4ba93175d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E8=BF=9C=E7=A5=A5?= <1141306760@qq.com> Date: Thu, 4 Sep 2025 17:36:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(Sidebar):=20=E5=8A=A8=E6=80=81=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=8A=80=E6=9C=AF=E6=A0=88=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 通过 API 获取页面配置数据 - 提取技术栈信息并传递给 IconCloud 组件 - 优化组件结构,支持异步数据加载 --- src/components/Sidebar/Study/index.tsx | 28 +++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/components/Sidebar/Study/index.tsx b/src/components/Sidebar/Study/index.tsx index 269f593..7019828 100644 --- a/src/components/Sidebar/Study/index.tsx +++ b/src/components/Sidebar/Study/index.tsx @@ -1,19 +1,23 @@ import Image from 'next/image'; import IconCloud from '@/app/my/component/IconCloud'; import StudySvg from '@/assets/svg/other/study.svg'; +import {getPageConfigDataByNameAPI} from '@/api/config'; +import {Config} from '@/types/app/config'; +import {MyData} from '@/types/app/my'; -const techIcons = ['scss', 'css', 'html', 'tailwindcss', 'axios', 'fetch', 'vue', 'vuex', 'redux', 'zustand', 'element-plus', 'typescript', 'javascript', 'antdesign', 'motion', 'pinia', 'framer-motion', 'echarts', 'java', 'spring', 'springboot', 'mybatis', 'mybatis-plus', 'redis', 'rabbitmq', 'mysql', 'mongodb', 'react', 'nextjs', 'nestjs', 'webpack', 'vite', 'nodedotjs', 'nextdotjs', 'prisma', 'koa', 'express', 'python', 'flask', 'nginx', 'vercel', 'docker', 'git', 'github', 'visualstudiocode', 'intellijidea', 'datagrip', 'apifox', 'postman', 'trae', 'cursor', 'webstorm', 'navicat', 'hbuilder', 'hbuilderx', 'googledrive', 'apple', 'windows', 'linux', 'pycharm', 'wechat']; -export default () => { - return ( -
-
- 最新评论 学无止境 -
+export default async () => { + const {data} = (await getPageConfigDataByNameAPI('my')) || {data: {} as Config}; + const { technology_stack } = data.value as MyData; + return ( +
+
+ 最新评论 学无止境 +
-
- -
-
- ); +
+ +
+
+ ); };