From 3f6c3b08d8b364d1b3727754aeea379fda78f1b7 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 10 Jun 2023 15:05:53 +0800 Subject: [PATCH] feat: add limit for temporary to verify email --- client/shared/i18n/langs/en-US/translation.json | 1 + client/shared/i18n/langs/zh-CN/translation.json | 1 + .../web/src/components/modals/SettingsView/Account.tsx | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/client/shared/i18n/langs/en-US/translation.json b/client/shared/i18n/langs/en-US/translation.json index 1f2f62de66e..4075ba9932d 100644 --- a/client/shared/i18n/langs/en-US/translation.json +++ b/client/shared/i18n/langs/en-US/translation.json @@ -89,6 +89,7 @@ "k4231ab36": "Performance statistics", "k42a98418": "File Service", "k4539164b": "The OTP code is 6 digits", + "k45e2f71f": "Temporary users cannot verify email address, please claim account first", "k4603baea": "Create Group Panel", "k47489688": "Group Service", "k48a38bc1": "Group not found", diff --git a/client/shared/i18n/langs/zh-CN/translation.json b/client/shared/i18n/langs/zh-CN/translation.json index e1375381b44..55b4aca256c 100644 --- a/client/shared/i18n/langs/zh-CN/translation.json +++ b/client/shared/i18n/langs/zh-CN/translation.json @@ -89,6 +89,7 @@ "k4231ab36": "性能统计", "k42a98418": "文件服务", "k4539164b": "校验码为6位", + "k45e2f71f": "临时用户无法认证邮箱, 请先认领账号", "k4603baea": "创建群组面板", "k47489688": "群组服务", "k48a38bc1": "群组不存在", diff --git a/client/web/src/components/modals/SettingsView/Account.tsx b/client/web/src/components/modals/SettingsView/Account.tsx index bf00204b7ee..08a421ebf3f 100644 --- a/client/web/src/components/modals/SettingsView/Account.tsx +++ b/client/web/src/components/modals/SettingsView/Account.tsx @@ -8,7 +8,7 @@ import { closeModal, pluginUserExtraInfo } from '@/plugin/common'; import { getGlobalSocket } from '@/utils/global-state-helper'; import { setUserJWT } from '@/utils/jwt-helper'; import { setGlobalUserLoginInfo } from '@/utils/user-helper'; -import { Button, Divider, Tag, Typography } from 'antd'; +import { Button, Divider, message, Tag, Typography } from 'antd'; import React, { useCallback } from 'react'; import { useNavigate } from 'react-router'; import { Avatar } from 'tailchat-design'; @@ -125,6 +125,13 @@ export const SettingsAccount: React.FC = React.memo(() => { color="warning" className="cursor-pointer" onClick={() => { + if (userInfo.temporary) { + message.warning( + t('临时用户无法认证邮箱, 请先认领账号') + ); + return; + } + const key = openModal( {