mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 07:31:19 +00:00
fix:change docs url (#5307)
This commit is contained in:
5
document/app/[lang]/(home)/[...not-found]/page.tsx
Normal file
5
document/app/[lang]/(home)/[...not-found]/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export default function HomePage() {
|
||||
redirect(`/docs/introduction`);
|
||||
}
|
@@ -1,6 +1,7 @@
|
||||
import { source } from '@/lib/source';
|
||||
import { DocsPage, DocsBody, DocsDescription, DocsTitle } from 'fumadocs-ui/page';
|
||||
import { notFound } from 'next/navigation';
|
||||
import NotFound from '@/components/docs/not-found';
|
||||
import { createRelativeLink } from 'fumadocs-ui/mdx';
|
||||
import { getMDXComponents } from '@/mdx-components';
|
||||
|
||||
@@ -11,7 +12,11 @@ export default async function Page({
|
||||
}) {
|
||||
const { lang, slug } = await params;
|
||||
const page = source.getPage(slug, lang);
|
||||
if (!page || !page.data || !page.file) notFound();
|
||||
|
||||
// 如果页面不存在,调用 notFound()
|
||||
if (!page || !page.data || !page.file) {
|
||||
return <NotFound />;
|
||||
}
|
||||
|
||||
const MDXContent = page.data.body;
|
||||
|
||||
|
Reference in New Issue
Block a user