|
|
@ -13,7 +13,23 @@ export const metadata: Metadata = {
|
|
|
|
const getCategoryList = async () => {
|
|
|
|
const getCategoryList = async () => {
|
|
|
|
const result = await apiSearchCategoryList();
|
|
|
|
const result = await apiSearchCategoryList();
|
|
|
|
if (result.code !== 200) return notFound();
|
|
|
|
if (result.code !== 200) return notFound();
|
|
|
|
return result.data;
|
|
|
|
|
|
|
|
|
|
|
|
// 去除空格
|
|
|
|
|
|
|
|
const list: Category[] = result.data.map((item) => {
|
|
|
|
|
|
|
|
return { ...item, nameEn: item.nameEn.replace(/ /g, '') };
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 添加“全部”tag
|
|
|
|
|
|
|
|
list.unshift({
|
|
|
|
|
|
|
|
id: '0',
|
|
|
|
|
|
|
|
nameCh: '全部',
|
|
|
|
|
|
|
|
nameEn: 'all',
|
|
|
|
|
|
|
|
image: '',
|
|
|
|
|
|
|
|
thumbnail: '',
|
|
|
|
|
|
|
|
description: '',
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getRecommendList = async () => {
|
|
|
|
const getRecommendList = async () => {
|
|
|
@ -45,7 +61,7 @@ export default async function Journal({ params }: { params: { category?: string;
|
|
|
|
{/* 左侧 */}
|
|
|
|
{/* 左侧 */}
|
|
|
|
<div className="w-[712px] mt-[50px]">
|
|
|
|
<div className="w-[712px] mt-[50px]">
|
|
|
|
{/* category */}
|
|
|
|
{/* category */}
|
|
|
|
<Category current={categoryInfo?.nameEn ?? 'all'} />
|
|
|
|
<Category list={categoryList} current={categoryInfo?.id ?? '0'} />
|
|
|
|
{/* */}
|
|
|
|
{/* */}
|
|
|
|
<div className="flex flex-row items-center justify-between mt-[33px]">
|
|
|
|
<div className="flex flex-row items-center justify-between mt-[33px]">
|
|
|
|
<div className="text-[17px] leading-[23.8px]">{categoryInfo?.nameCh ?? '全部'}</div>
|
|
|
|
<div className="text-[17px] leading-[23.8px]">{categoryInfo?.nameCh ?? '全部'}</div>
|
|
|
|