From 83e7cd3c4d4b4ae0c15340fbb3206d69bc13629c Mon Sep 17 00:00:00 2001 From: quantulr <35954003+quantulr@users.noreply.github.com> Date: Tue, 7 Nov 2023 17:14:42 +0800 Subject: [PATCH] update --- .../academic-events/[articleId]/page.tsx | 18 ++++++++++++++- .../research-progress/[articleId]/page.tsx | 4 ++-- app/_components/AnhuiSwiper.tsx | 3 ++- app/_components/BranchLifeSketch.tsx | 8 +------ next.config.js | 23 +++++++++++-------- 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/app/(articles)/academic-exchange/academic-events/[articleId]/page.tsx b/app/(articles)/academic-exchange/academic-events/[articleId]/page.tsx index d4e6aa5..44ecafb 100644 --- a/app/(articles)/academic-exchange/academic-events/[articleId]/page.tsx +++ b/app/(articles)/academic-exchange/academic-events/[articleId]/page.tsx @@ -13,7 +13,23 @@ const Page = async ({ const data = await articleDetail({ id: articleId }); return ( <> - + diff --git a/app/(articles)/research-progress/[articleId]/page.tsx b/app/(articles)/research-progress/[articleId]/page.tsx index 7aa8dfc..1284033 100644 --- a/app/(articles)/research-progress/[articleId]/page.tsx +++ b/app/(articles)/research-progress/[articleId]/page.tsx @@ -14,8 +14,8 @@ export default async function ResearchProgress({ diff --git a/app/_components/AnhuiSwiper.tsx b/app/_components/AnhuiSwiper.tsx index 116a5e9..8afeb79 100644 --- a/app/_components/AnhuiSwiper.tsx +++ b/app/_components/AnhuiSwiper.tsx @@ -9,6 +9,7 @@ import "swiper/css"; import "swiper/css/pagination"; import "swiper/css/effect-coverflow"; import "swiper/css/autoplay"; +import Image from "next/image"; const data = [ { @@ -134,7 +135,7 @@ const AnhuiSwiper = () => { swiper?.destroy(); swiper = null; }; - }, [data]); + }, []); return (
{ className={"aspect-square"} href={`/branch-life-sketch/${article.id}`} > - {""} + {""}
diff --git a/next.config.js b/next.config.js index 2cec0c5..f9a789a 100644 --- a/next.config.js +++ b/next.config.js @@ -1,16 +1,19 @@ /** @type {import("next").NextConfig} */ const nextConfig = { async rewrites() { - return [ - { - source: "/api/:path*", - destination: "http://localhost:8084/api/:path*" - }, { - source: "/admin-api/:path*", - destination: "http://localhost:8082/api/:path*" - }, - ]; - } + return process.env.NODE_ENV === "development" + ? [ + { + source: "/api/:path*", + destination: "http://localhost:8084/api/:path*", + }, + { + source: "/admin-api/:path*", + destination: "http://localhost:8082/api/:path*", + }, + ] + : []; + }, }; module.exports = nextConfig;