bugfix
This commit is contained in:
@ -1,2 +1,2 @@
|
|||||||
NEXT_PUBLIC_ADMIN_BASE_URL=/admin-api
|
NEXT_PUBLIC_ADMIN_BASE_URL=http://101.34.131.16:8082/api
|
||||||
NEXT_PUBLIC_FRONT_BASE_URL=/front-api
|
NEXT_PUBLIC_FRONT_BASE_URL=http://101.34.131.16:8084/api
|
||||||
|
19
app/(articles)/media-scan/[articleId]/layout.tsx
Normal file
19
app/(articles)/media-scan/[articleId]/layout.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { ReactNode } from "react";
|
||||||
|
import ArticleLayout from "@/app/components/ArticleLayout";
|
||||||
|
|
||||||
|
const Layout = ({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: ReactNode;
|
||||||
|
params: {
|
||||||
|
articleId: string;
|
||||||
|
};
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<ArticleLayout leftNavTitle={"媒体扫描"} navigations={[]}>
|
||||||
|
{children}
|
||||||
|
</ArticleLayout>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Layout;
|
24
app/(articles)/media-scan/[articleId]/page.tsx
Normal file
24
app/(articles)/media-scan/[articleId]/page.tsx
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { articleDetail } from "@/app/api/articles";
|
||||||
|
import ArticleRender from "@/app/components/ArticleRender";
|
||||||
|
import ArticleWithBreadcrumb from "@/app/components/ArticleWithBreadcrumb";
|
||||||
|
|
||||||
|
export default async function Article({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: {
|
||||||
|
articleId: string;
|
||||||
|
};
|
||||||
|
}) {
|
||||||
|
const data = await articleDetail({ id: params.articleId });
|
||||||
|
return (
|
||||||
|
<ArticleWithBreadcrumb
|
||||||
|
breadcrumb={[
|
||||||
|
{ title: "首页", href: "/" },
|
||||||
|
{ title: "媒体扫描", href: "/media-scan/pages/1" },
|
||||||
|
{ title: data.title, href: `/media-scan/${data.id}` },
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<ArticleRender article={data} />
|
||||||
|
</ArticleWithBreadcrumb>
|
||||||
|
);
|
||||||
|
}
|
20
app/(articles)/media-scan/pages/[pageIndex]/layout.tsx
Normal file
20
app/(articles)/media-scan/pages/[pageIndex]/layout.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { ReactNode } from "react";
|
||||||
|
import ArticleLayout from "@/app/components/ArticleLayout";
|
||||||
|
import Breadcrumb, { BreadcrumbItem } from "@/app/components/Breadcrumb";
|
||||||
|
import ArticleWithBreadcrumb from "@/app/components/ArticleWithBreadcrumb";
|
||||||
|
|
||||||
|
const breadcrumb: BreadcrumbItem[] = [
|
||||||
|
{ title: "首页", href: "/" },
|
||||||
|
{ title: "媒体扫描", href: "/media-scan/pages/1" },
|
||||||
|
];
|
||||||
|
const Layout = ({ children }: { children: ReactNode }) => {
|
||||||
|
return (
|
||||||
|
<ArticleLayout navigations={[]} leftNavTitle={"媒体扫描"}>
|
||||||
|
<ArticleWithBreadcrumb breadcrumb={breadcrumb}>
|
||||||
|
{children}
|
||||||
|
</ArticleWithBreadcrumb>
|
||||||
|
</ArticleLayout>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Layout;
|
18
app/(articles)/media-scan/pages/[pageIndex]/page.tsx
Normal file
18
app/(articles)/media-scan/pages/[pageIndex]/page.tsx
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import ArticleList from "@/app/components/ArticleList";
|
||||||
|
|
||||||
|
const Page = ({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: {
|
||||||
|
pageIndex: string;
|
||||||
|
};
|
||||||
|
}) => {
|
||||||
|
const { pageIndex } = params;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ArticleList title={"媒体扫描"} cid={"8"} pageNo={parseInt(pageIndex)} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Page;
|
@ -50,7 +50,7 @@ const ArticleBlock = async ({
|
|||||||
</div>
|
</div>
|
||||||
<div className={`${styles.articlesList} bg-[#e1f1fd] flex-1`}>
|
<div className={`${styles.articlesList} bg-[#e1f1fd] flex-1`}>
|
||||||
<ul>
|
<ul>
|
||||||
{data.lists.map((article) => (
|
{data.lists?.map((article) => (
|
||||||
<li className={"h-8"} key={article.id}>
|
<li className={"h-8"} key={article.id}>
|
||||||
<Link
|
<Link
|
||||||
className={
|
className={
|
||||||
|
@ -10,7 +10,7 @@ const LatestNews = async () => {
|
|||||||
pageSize: 1,
|
pageSize: 1,
|
||||||
sort: "new",
|
sort: "new",
|
||||||
});
|
});
|
||||||
if (!lists.length) {
|
if (!lists?.length) {
|
||||||
return <></>;
|
return <></>;
|
||||||
}
|
}
|
||||||
const { id } = lists[0];
|
const { id } = lists[0];
|
||||||
@ -18,22 +18,21 @@ const LatestNews = async () => {
|
|||||||
id: `${id}`,
|
id: `${id}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
// const text = window.document.createElement("div");
|
|
||||||
// text.innerHTML = article.content;
|
|
||||||
const content = htmlToText(article.content, {
|
const content = htmlToText(article.content, {
|
||||||
// baseElements:{
|
|
||||||
// selectors:['p']
|
|
||||||
// }
|
|
||||||
selectors: [{ selector: "img", format: "skip" }],
|
selectors: [{ selector: "img", format: "skip" }],
|
||||||
});
|
});
|
||||||
// const content = text.innerText;
|
|
||||||
return (
|
return (
|
||||||
<div className={"h-[180px] bg-white p-2 flex"}>
|
<div className={"h-[180px] bg-white p-2 flex"}>
|
||||||
<Link
|
<Link
|
||||||
href={`general-news/${lists[0].id}`}
|
href={`general-news/${lists[0].id}`}
|
||||||
className={"article-cover w-[207px]"}
|
className={"article-cover w-[207px]"}
|
||||||
>
|
>
|
||||||
<Image src={article.image} alt={""} />
|
<img
|
||||||
|
className={"w-full h-full object-cover"}
|
||||||
|
src={`${process.env.NEXT_PUBLIC_ADMIN_BASE_URL}/uploads/${article.image}`}
|
||||||
|
alt={""}
|
||||||
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
<div className={"w-0 flex-1 ml-1 relative"}>
|
<div className={"w-0 flex-1 ml-1 relative"}>
|
||||||
<Link
|
<Link
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
|
eslint: {
|
||||||
|
// Warning: This allows production builds to successfully complete even if
|
||||||
|
// your project has ESLint errors.
|
||||||
|
// ignoreDuringBuilds: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig
|
||||||
|
Reference in New Issue
Block a user