|
|
@ -1,5 +1,5 @@
|
|
|
|
/** 期刊详情 */
|
|
|
|
/** 期刊详情 */
|
|
|
|
import { notFound } from 'next/navigation';
|
|
|
|
import { notFound, redirect, RedirectType } from 'next/navigation';
|
|
|
|
|
|
|
|
|
|
|
|
import { SongCardList, JournalRecommendList, Comment, CollectButton, VolDetailCoverCard } from '@/components';
|
|
|
|
import { SongCardList, JournalRecommendList, Comment, CollectButton, VolDetailCoverCard } from '@/components';
|
|
|
|
import { apiGetJournalInfoById, apiGetSongsByJournalNo, apiGetJournalRecommendById } from '@/services';
|
|
|
|
import { apiGetJournalInfoById, apiGetSongsByJournalNo, apiGetJournalRecommendById } from '@/services';
|
|
|
@ -20,9 +20,19 @@ const getData = async (journalId: string) => {
|
|
|
|
return { journalInfo: journalInfoRes.data, songList: songListRes.data, recommendList: recommendList.data };
|
|
|
|
return { journalInfo: journalInfoRes.data, songList: songListRes.data, recommendList: recommendList.data };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default async function JournalDetail({ params: { journalId } }: { params: { journalId: string } }) {
|
|
|
|
export default async function JournalDetail({
|
|
|
|
|
|
|
|
params: { journalId },
|
|
|
|
|
|
|
|
searchParams: { mobile },
|
|
|
|
|
|
|
|
}: {
|
|
|
|
|
|
|
|
params: { journalId: string };
|
|
|
|
|
|
|
|
searchParams: { mobile: string };
|
|
|
|
|
|
|
|
}) {
|
|
|
|
const { journalInfo, songList, recommendList } = await getData(journalId);
|
|
|
|
const { journalInfo, songList, recommendList } = await getData(journalId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mobile) {
|
|
|
|
|
|
|
|
redirect(`${process.env.NEXT_PUBLIC_MOBILE_HOST}/html/journal.html?id=${journalInfo.id}`, RedirectType.replace);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<main className="w-[1200px] mx-auto flex flex-row justify-between pt-[145px]">
|
|
|
|
<main className="w-[1200px] mx-auto flex flex-row justify-between pt-[145px]">
|
|
|
|
<div className="w-[712px]">
|
|
|
|
<div className="w-[712px]">
|
|
|
|