Skip to content

Commit 66acf46

Browse files
committed
fix: nav config build error
1 parent aff7692 commit 66acf46

File tree

2 files changed

+2
-378
lines changed

2 files changed

+2
-378
lines changed

client/pages/nav/[id].tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Helmet } from 'react-helmet';
99
import { ArticleRecommend } from '@/components/ArticleRecommend';
1010
import { GlobalContext } from '@/context/global';
1111
import { DoubleColumnLayout } from '@/layout/DoubleColumnLayout';
12-
import config from './config';
1312

1413
import AboutUs from '@/components/AboutUs';
1514
import { Tags } from '@/components/Tags';
@@ -145,7 +144,8 @@ const Article: NextPage<IProps> = ({ article }) => {
145144
Article.getInitialProps = async (ctx) => {
146145
const { id } = ctx.query;
147146
const [siteKey] = typeof id === 'string' ? id.split('.') : id;
148-
const urlItem = config.urlConfig
147+
const { globalSetting } = useContext(GlobalContext);
148+
const urlItem = globalSetting?.globalConfig?.urlConfig
149149
.map((item) => item.children)
150150
.flat()
151151
.find((item) => item.key === siteKey);

client/pages/nav/config.tsx

Lines changed: 0 additions & 376 deletions
This file was deleted.

0 commit comments

Comments
 (0)