diff --git a/GZCTF/ClientApp/src/components/WithGameTab.tsx b/GZCTF/ClientApp/src/components/WithGameTab.tsx index b9f0efc39..8007bd99e 100644 --- a/GZCTF/ClientApp/src/components/WithGameTab.tsx +++ b/GZCTF/ClientApp/src/components/WithGameTab.tsx @@ -11,7 +11,7 @@ import { useUserRole } from '@Utils/useUser' import { GameDetailModel, ParticipationStatus, Role } from '@Api' import CustomProgress from './CustomProgress' import IconTabs from './IconTabs' -import { RoleMap } from './WithRole' +import { RequireRole, RoleMap } from './WithRole' const pages = [ { @@ -129,14 +129,25 @@ const WithGameTab: FC = ({ game, isLoading, status, children } }) useEffect(() => { - if (dayjs() < dayjs(game?.start)) { - navigate(`/games/${numId}`) - showNotification({ - color: 'yellow', - message: '比赛尚未开始', - icon: , - disallowClose: true, - }) + if (game) { + const now = dayjs() + if (now < dayjs(game.start)) { + navigate(`/games/${numId}`) + showNotification({ + color: 'yellow', + message: '比赛尚未开始', + icon: , + disallowClose: true, + }) + } else if (!game.practiceMode && now > dayjs(game.end) && !RequireRole(Role.Monitor)) { + navigate(`/games/${numId}`) + showNotification({ + color: 'yellow', + message: '比赛已经结束', + icon: , + disallowClose: true, + }) + } } }, [game]) diff --git a/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx b/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx index 80797e635..1b3c2410a 100644 --- a/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx +++ b/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx @@ -289,108 +289,105 @@ const GameInfoEdit: FC = () => { required /> - - - - - 比赛签名公钥 - - 用于验证队伍 Token - - - } - readOnly - onClick={() => { - clipboard.copy(game?.publicKey || '') - showNotification({ - color: 'teal', - message: '公钥已复制到剪贴板', - icon: , - disallowClose: true, - }) - }} - /> -