update
This commit is contained in:
@ -1,4 +1,2 @@
|
||||
NEXT_PUBLIC_ADMIN_BASE_URL=http://localhost:8082/api
|
||||
NEXT_PUBLIC_FRONT_BASE_URL=http://localhost:8084/api
|
||||
NEXT_PUBLIC_BASE_URL=http://localhost:8086/api
|
||||
NEXT_PUBLIC_CLIENT_BASE_URL=/api
|
||||
NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL=/admin-api
|
||||
|
@ -6,7 +6,7 @@ const Page = () => {
|
||||
<ArticleHeading text={"组织架构"} />
|
||||
<img
|
||||
className={"w-full"}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL}/uploads/image/20231030/5c0b98dc-cf76-49c3-a510-f2f197f7dd09.jpeg`}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_BASE_URL}/uploads/image/20231030/5c0b98dc-cf76-49c3-a510-f2f197f7dd09.jpeg`}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
@ -8,7 +8,7 @@ const Page = () => {
|
||||
<p className={"text-center text-base"}>中科院院士</p>
|
||||
<p className={"mt-2 flex justify-center"}>
|
||||
<img
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL}/uploads/image/20231030/8d05e613-e2c6-47d1-81a9-08bd70b8ba73.jpeg`}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_BASE_URL}/uploads/image/20231030/8d05e613-e2c6-47d1-81a9-08bd70b8ba73.jpeg`}
|
||||
alt={"张景中"}
|
||||
/>
|
||||
</p>
|
||||
|
@ -59,7 +59,7 @@ const Page = () => {
|
||||
>
|
||||
<img
|
||||
className={"h-[138px]"}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL}${academician.picture}`}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_BASE_URL}${academician.picture}`}
|
||||
/>
|
||||
<Link href={academician.link}>{academician.name}</Link>
|
||||
</div>
|
||||
|
@ -28,7 +28,7 @@ const Page = () => {
|
||||
>
|
||||
<img
|
||||
className={"h-[138px]"}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL}${academician.picture}`}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_BASE_URL}${academician.picture}`}
|
||||
/>
|
||||
<Link href={academician.link}>{academician.name}</Link>
|
||||
</div>
|
||||
|
@ -153,7 +153,7 @@ const AnhuiSwiper = () => {
|
||||
<img
|
||||
className={"h-full w-full object-contain"}
|
||||
src={`${
|
||||
process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL
|
||||
process.env.NEXT_PUBLIC_CLIENT_BASE_URL
|
||||
}${el.path.match(/\/uploads\/.*/)?.[0]}`}
|
||||
alt={""}
|
||||
/>
|
||||
|
@ -2,7 +2,6 @@ import Image from "next/image";
|
||||
import trumpetIcon from "@/app/_assets/trumpet-icon.png";
|
||||
import styles from "@/app/_assets/page.module.css";
|
||||
import Link from "next/link";
|
||||
import request from "@/app/_lib/request";
|
||||
import { listArticles } from "@/app/_services/articles";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
|
@ -84,7 +84,7 @@ const ArticleItem = ({ article }: { article: Article }) => {
|
||||
className={"h-full w-full"}
|
||||
src={
|
||||
cover_path
|
||||
? `${process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL}${cover_path}`
|
||||
? `${process.env.NEXT_PUBLIC_CLIENT_BASE_URL}${cover_path}`
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
|
@ -30,7 +30,7 @@ const LatestNews = async () => {
|
||||
>
|
||||
<img
|
||||
className={"h-full w-full object-cover"}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL}/uploads/${article.image}`}
|
||||
src={`${process.env.NEXT_PUBLIC_CLIENT_BASE_URL}/uploads/${article.image}`}
|
||||
alt={""}
|
||||
/>
|
||||
</Link>
|
||||
|
@ -1,14 +1,12 @@
|
||||
import axios from "axios";
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
baseURL: process.env.NEXT_PUBLIC_FRONT_BASE_URL,
|
||||
baseURL: process.env.NEXT_PUBLIC_BASE_URL,
|
||||
});
|
||||
|
||||
const axiosClientInstance = axios.create({
|
||||
baseURL: process.env.NEXT_PUBLIC_CLIENT_BASE_URL,
|
||||
});
|
||||
const axiosClientAdminInstance = axios.create({
|
||||
baseURL: process.env.NEXT_PUBLIC_CLIENT_ADMIN_BASE_URL,
|
||||
});
|
||||
|
||||
axiosInstance.interceptors.response.use((response) => {
|
||||
return response.data;
|
||||
@ -17,9 +15,6 @@ axiosInstance.interceptors.response.use((response) => {
|
||||
axiosClientInstance.interceptors.response.use((response) => {
|
||||
return response.data;
|
||||
});
|
||||
axiosClientAdminInstance.interceptors.response.use((response) => {
|
||||
return response.data;
|
||||
});
|
||||
|
||||
export { axiosClientInstance, axiosClientAdminInstance };
|
||||
export { axiosClientInstance };
|
||||
export default axiosInstance;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import request from "@/app/_lib/request";
|
||||
import { BaseResponse, PageData } from "@/app/_types/base";
|
||||
import { PageData } from "@/app/_types/base";
|
||||
import {
|
||||
Article,
|
||||
ArticleDetail,
|
||||
@ -7,18 +6,30 @@ import {
|
||||
ArticleListParams,
|
||||
} from "@/app/_types/article";
|
||||
|
||||
export const listArticles = (params: ArticleListParams) =>
|
||||
request
|
||||
.get<never, BaseResponse<PageData<Article>>>("/article/list", {
|
||||
params,
|
||||
})
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
});
|
||||
export const listArticles = (
|
||||
params: ArticleListParams,
|
||||
): Promise<PageData<Article>> =>
|
||||
fetch(
|
||||
`${process.env.NEXT_PUBLIC_BASE_URL}/article/list?${new URLSearchParams(
|
||||
params as Record<string, any>,
|
||||
)}`,
|
||||
{
|
||||
cache: "no-store",
|
||||
},
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((json) => json.data);
|
||||
|
||||
export const articleDetail = (params: ArticleDetailParams) =>
|
||||
request
|
||||
.get<never, BaseResponse<ArticleDetail>>("/pc/articleDetail", {
|
||||
params,
|
||||
})
|
||||
.then((res) => res.data);
|
||||
export const articleDetail = (
|
||||
params: ArticleDetailParams,
|
||||
): Promise<ArticleDetail> =>
|
||||
fetch(
|
||||
`${process.env.NEXT_PUBLIC_BASE_URL}/pc/articleDetail?${new URLSearchParams(
|
||||
params as Record<string, any>,
|
||||
)}`,
|
||||
{
|
||||
cache: "no-store",
|
||||
},
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((json) => json.data);
|
||||
|
@ -8,7 +8,6 @@ import FriendLinks from "@/app/_components/FriendLinks";
|
||||
import BranchLifeSketch from "@/app/_components/BranchLifeSketch";
|
||||
import { ReactNode } from "react";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
export default async function Home() {
|
||||
return (
|
||||
<main className={"mt-1 flex justify-between bg-[#f5fafe]"}>
|
||||
|
@ -4,12 +4,12 @@ const nextConfig = {
|
||||
return process.env.NODE_ENV === "development"
|
||||
? [
|
||||
{
|
||||
source: "/api/:path*",
|
||||
destination: "http://101.34.131.16:8086/api/:path*",
|
||||
source: "/api/uploads/:path*",
|
||||
destination: "http://101.34.131.16:8086/api/uploads/:path*",
|
||||
},
|
||||
{
|
||||
source: "/admin-api/:path*",
|
||||
destination: "http://101.34.131.16:8086/admin-api/:path*",
|
||||
source: "/api/:path*",
|
||||
destination: "http://101.34.131.16:8086/api/:path*",
|
||||
},
|
||||
]
|
||||
: [];
|
||||
|
Reference in New Issue
Block a user