fix @node-rs/jieba and window not found (#1313)

* dynamic import

* perf: entry

* fix: jieba package
This commit is contained in:
Archer
2024-04-28 10:27:34 +08:00
committed by GitHub
parent d407e87dd9
commit 59ece446a2
16 changed files with 560 additions and 139 deletions

View File

@@ -1,8 +1,10 @@
import Markdown from '@/components/Markdown';
import { useMarkdown } from '@/web/common/hooks/useMarkdown';
import { Box, Card } from '@chakra-ui/react';
import React from 'react';
import dynamic from 'next/dynamic';
const Markdown = dynamic(() => import('@/components/Markdown'), { ssr: false });
const Empty = () => {
const { data: chatProblem } = useMarkdown({ url: '/chatProblem.md' });
const { data: versionIntro } = useMarkdown({ url: '/versionIntro.md' });

View File

@@ -10,6 +10,7 @@ import { getUnreadCount } from '@/web/support/user/inform/api';
import dynamic from 'next/dynamic';
import Auth from './auth';
const Navbar = dynamic(() => import('./navbar'));
const NavbarPhone = dynamic(() => import('./navbarPhone'));
const UpdateInviteModal = dynamic(() => import('@/components/support/user/team/UpdateInviteModal'));
@@ -112,14 +113,13 @@ const Layout = ({ children }: { children: JSX.Element }) => {
</Box>
</>
)}
{!!userInfo && <UpdateInviteModal />}
{isNotSufficientModal && !isHideNavbar && <NotSufficientModal />}
{!!userInfo && <SystemMsgModal />}
{!!userInfo && importantInforms.length > 0 && (
<ImportantInform informs={importantInforms} refetch={refetchUnRead} />
)}
</Box>
{!!userInfo && <UpdateInviteModal />}
{isNotSufficientModal && !isHideNavbar && <NotSufficientModal />}
{!!userInfo && <SystemMsgModal />}
{!!userInfo && importantInforms.length > 0 && (
<ImportantInform informs={importantInforms} refetch={refetchUnRead} />
)}
<Loading loading={loading} zIndex={999999} />
</>
);

View File

@@ -60,4 +60,4 @@ const ImportantInform = ({
);
};
export default ImportantInform;
export default React.memo(ImportantInform);

View File

@@ -6,7 +6,8 @@ import { Button, ModalBody, ModalFooter, useDisclosure } from '@chakra-ui/react'
import { useTranslation } from 'next-i18next';
import { LOGO_ICON } from '@fastgpt/global/common/system/constants';
import { getSystemMsgModalData } from '@/web/support/user/inform/api';
import Markdown from '@/components/Markdown';
import dynamic from 'next/dynamic';
const Markdown = dynamic(() => import('@/components/Markdown'), { ssr: false });
const SystemMsgModal = ({}: {}) => {
const { t } = useTranslation();