diff --git a/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx b/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx index 1f44cf06a..e6ed166f4 100644 --- a/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx +++ b/src/GZCTF/ClientApp/src/pages/admin/games/[id]/Info.tsx @@ -285,6 +285,7 @@ const GameInfoEdit: FC = () => { .hour(Number(newTime[0])) .minute(Number(newTime[1])) .second(Number(newTime[2])) + .millisecond(0) setStart(newDate) if (newDate && end < newDate) { setEnd(newDate.add(2, 'h')) @@ -318,6 +319,7 @@ const GameInfoEdit: FC = () => { .hour(Number(newTime[0])) .minute(Number(newTime[1])) .second(Number(newTime[2])) + .millisecond(0) setEnd(newDate) }} error={end < start} diff --git a/src/GZCTF/ClientApp/src/utils/useGame.ts b/src/GZCTF/ClientApp/src/utils/useGame.ts index 60fad8262..bf1ce40ee 100644 --- a/src/GZCTF/ClientApp/src/utils/useGame.ts +++ b/src/GZCTF/ClientApp/src/utils/useGame.ts @@ -7,13 +7,12 @@ export const getGameStatus = (game?: DetailedGameInfoModel) => { const startTime = dayjs(game?.start) const endTime = dayjs(game?.end) - const duriation = endTime.diff(startTime, 'minute') + const total = endTime.diff(startTime, 'minute') const current = dayjs().diff(startTime, 'minute') - const finished = current > duriation + const finished = current > total const started = current > 0 - const total = endTime.diff(startTime, 'minute') - const progress = started ? (finished ? 1 : current / duriation) : 0 + const progress = started ? (finished ? 1 : current / total) : 0 const status = started ? (finished ? GameStatus.Ended : GameStatus.OnGoing) : GameStatus.Coming return { diff --git a/src/GZCTF/Services/MailSender.cs b/src/GZCTF/Services/MailSender.cs index 9ba25518a..77dc584cc 100644 --- a/src/GZCTF/Services/MailSender.cs +++ b/src/GZCTF/Services/MailSender.cs @@ -93,9 +93,9 @@ public bool SendConfirmEmailUrl(string? userName, string? email, string? confirm "确认验证邮箱", userName, email, confirmLink); public bool SendChangeEmailUrl(string? userName, string? email, string? resetLink) - => SendUrlIfPossible("更改邮箱", + => SendUrlIfPossible("更换邮箱", "你正在进行账户邮箱更换操作,请点击下方按钮验证你的新邮箱。", - "确认跟换邮箱", userName, email, resetLink); + "确认更换邮箱", userName, email, resetLink); public bool SendResetPasswordUrl(string? userName, string? email, string? resetLink) => SendUrlIfPossible("重置密码",