Skip to content

Commit ab359f5

Browse files
committed
fix: #346
Signed-off-by: Innei <[email protected]>
1 parent 742dd5e commit ab359f5

File tree

1 file changed

+21
-0
lines changed
  • src/app/(app)/posts/(post-detail)/[category]

1 file changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { redirect } from 'next/navigation'
2+
3+
import { apiClient } from '~/lib/request'
4+
import { definePrerenderPage } from '~/lib/request.server'
5+
6+
export default definePrerenderPage<{
7+
category: string
8+
}>()({
9+
fetcher({ category }) {
10+
return apiClient.post.getFullUrl(category)
11+
},
12+
Component({ data }) {
13+
redirect(`/posts${data.path}`)
14+
15+
return (
16+
<div>
17+
正在重定向到 <pre>{`/posts${data.path}`}</pre>
18+
</div>
19+
)
20+
},
21+
})

0 commit comments

Comments
 (0)