diff --git a/GZCTF/ClientApp/src/components/MarkdownRender.tsx b/GZCTF/ClientApp/src/components/MarkdownRender.tsx index ce3a1a7d4..3217dfce7 100644 --- a/GZCTF/ClientApp/src/components/MarkdownRender.tsx +++ b/GZCTF/ClientApp/src/components/MarkdownRender.tsx @@ -50,6 +50,7 @@ export const MarkdownRender = forwardRef((props, } }, renderer, + silent: true, }) return ( diff --git a/GZCTF/ClientApp/src/components/PostCard.tsx b/GZCTF/ClientApp/src/components/PostCard.tsx index 6f3e6f898..ffb9040a3 100644 --- a/GZCTF/ClientApp/src/components/PostCard.tsx +++ b/GZCTF/ClientApp/src/components/PostCard.tsx @@ -39,7 +39,7 @@ const PostCard: FC = ({ post, onTogglePinned }) => { - {post.autherName?.at(0) ?? 'A'} + {post.autherName?.slice(0, 1) ?? 'A'} {post.autherName ?? 'Anonym'} 发布于 {dayjs(post.time).format('HH:mm, YY/MM/DD')} diff --git a/GZCTF/ClientApp/src/components/ScoreboardTable.tsx b/GZCTF/ClientApp/src/components/ScoreboardTable.tsx index 24e76beab..a7f6fba1e 100644 --- a/GZCTF/ClientApp/src/components/ScoreboardTable.tsx +++ b/GZCTF/ClientApp/src/components/ScoreboardTable.tsx @@ -168,7 +168,7 @@ const TableRow: FC<{ }), })} > - {item.name?.at(0) ?? 'T'} + {item.name?.slice(0, 1) ?? 'T'} { title={ - {currentItem?.name?.at(0) ?? 'T'} + {currentItem?.name?.slice(0, 1) ?? 'T'} {currentItem?.name} diff --git a/GZCTF/ClientApp/src/components/TeamCard.tsx b/GZCTF/ClientApp/src/components/TeamCard.tsx index 63a30672e..1bbd7d713 100644 --- a/GZCTF/ClientApp/src/components/TeamCard.tsx +++ b/GZCTF/ClientApp/src/components/TeamCard.tsx @@ -48,7 +48,7 @@ const TeamCard: FC<TeamCardProps> = (props) => { <Stack style={{ flexGrow: 1 }}> <Group align="stretch" position="apart"> <Avatar color="cyan" size="lg" radius="md" src={team.avatar}> - {team.name?.at(0) ?? 'T'} + {team.name?.slice(0, 1) ?? 'T'} </Avatar> <Stack spacing={0} style={{ width: 'calc(100% - 72px)' }}> diff --git a/GZCTF/ClientApp/src/components/TeamRank.tsx b/GZCTF/ClientApp/src/components/TeamRank.tsx index 6f573c835..43fe372ad 100644 --- a/GZCTF/ClientApp/src/components/TeamRank.tsx +++ b/GZCTF/ClientApp/src/components/TeamRank.tsx @@ -55,7 +55,7 @@ const TeamRank: FC<PaperProps> = (props) => { <Stack spacing={8}> <Group> <Avatar color="cyan" size="md" radius="md" src={data?.rank?.avatar}> - {data?.rank?.name?.at(0) ?? 'T'} + {data?.rank?.name?.slice(0, 1) ?? 'T'} </Avatar> <Skeleton width="8rem" visible={!data}> <Title order={4}>{data?.rank?.name ?? 'Team'} diff --git a/GZCTF/ClientApp/src/pages/admin/Teams.tsx b/GZCTF/ClientApp/src/pages/admin/Teams.tsx index b4edaf8dd..48bb5cee2 100644 --- a/GZCTF/ClientApp/src/pages/admin/Teams.tsx +++ b/GZCTF/ClientApp/src/pages/admin/Teams.tsx @@ -155,7 +155,7 @@ const Teams: FC = () => { - {team.name?.at(0)} + {team.name?.slice(0, 1)} {team.name} diff --git a/GZCTF/ClientApp/src/pages/admin/games/Index.tsx b/GZCTF/ClientApp/src/pages/admin/games/Index.tsx index dd92613c9..5b45ab44b 100644 --- a/GZCTF/ClientApp/src/pages/admin/games/Index.tsx +++ b/GZCTF/ClientApp/src/pages/admin/games/Index.tsx @@ -129,7 +129,7 @@ const Games: FC = () => { sx={{ cursor: 'pointer' }} > - {game.title?.at(0)} + {game.title?.slice(0, 1)} {game.title} diff --git a/GZCTF/ClientApp/src/pages/posts/[postId]/Index.tsx b/GZCTF/ClientApp/src/pages/posts/[postId]/Index.tsx index df33e8194..a35fe5fe6 100644 --- a/GZCTF/ClientApp/src/pages/posts/[postId]/Index.tsx +++ b/GZCTF/ClientApp/src/pages/posts/[postId]/Index.tsx @@ -53,7 +53,7 @@ const Post: FC = () => { {post?.title} - {post?.autherName?.at(0) ?? 'A'} + {post?.autherName?.slice(0, 1) ?? 'A'} {post?.autherName ?? 'Anonym'} @@ -75,7 +75,7 @@ const Post: FC = () => { )} - {post?.autherName?.at(0) ?? 'A'} + {post?.autherName?.slice(0, 1) ?? 'A'} {post?.autherName ?? 'Anonym'} 发布于 {dayjs(post?.time).format('HH:mm, YY/MM/DD')} diff --git a/GZCTF/ClientApp/vite.config.ts b/GZCTF/ClientApp/vite.config.ts index ecfede30b..2164a94e0 100644 --- a/GZCTF/ClientApp/vite.config.ts +++ b/GZCTF/ClientApp/vite.config.ts @@ -21,9 +21,12 @@ export default defineConfig(({ mode }) => { '/hub': { target: TARGET.replace('http', 'ws'), ws: true }, }, }, + preview: { + port: 64000 + }, build: { outDir: 'build', - target: ['es2018', 'chrome80'], + target: ['es2020', 'chrome86'], assetsDir: 'static', chunkSizeWarningLimit: 2000, rollupOptions: {