From 72bd47190db6a4f9acec9654b41366fb3b7d8a6a Mon Sep 17 00:00:00 2001 From: ee L Date: Tue, 27 Aug 2024 13:41:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E7=BE=A4=E7=BB=84=E5=86=85=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=A5=BD=E5=8F=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../popover/UserPopover/GroupUserPopover.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/client/web/src/components/popover/UserPopover/GroupUserPopover.tsx b/client/web/src/components/popover/UserPopover/GroupUserPopover.tsx index 96329fc45d3..ba0189e386f 100644 --- a/client/web/src/components/popover/UserPopover/GroupUserPopover.tsx +++ b/client/web/src/components/popover/UserPopover/GroupUserPopover.tsx @@ -13,6 +13,8 @@ import { useAsyncRequest, UserBaseInfo, useUserId, + request, + showToasts, } from 'tailchat-shared'; import { UserProfileContainer } from '../../UserProfileContainer'; import { usePluginUserExtraInfo } from './usePluginUserExtraInfo'; @@ -41,6 +43,15 @@ export const GroupUserPopover: React.FC<{ navigate(`/main/personal/converse/${converse._id}`); }, [navigate]); + // 一键添加好友 + const [, handleAddFriend] = useAsyncRequest(async () => { + const { data } = await request.post('/api/friend/request/add', { + to: userId, + }); + showToasts(t('成功发送好友申请')); + return data; + }, [userId, request]); + useEffect(() => { if (userInfo.avatar) { fetchImagePrimaryColor(userInfo.avatar).then((rgba) => { @@ -84,6 +95,12 @@ export const GroupUserPopover: React.FC<{
{pluginUserExtraInfoEl}
+ + + {allowSendMessage && ( Date: Tue, 27 Aug 2024 15:15:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E5=A4=84=E6=B7=BB=E5=8A=A0=E9=AA=8C=E8=AF=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/web/src/components/modals/ModifyPassword.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/web/src/components/modals/ModifyPassword.tsx b/client/web/src/components/modals/ModifyPassword.tsx index 535c8d5b273..529f8d45255 100644 --- a/client/web/src/components/modals/ModifyPassword.tsx +++ b/client/web/src/components/modals/ModifyPassword.tsx @@ -45,6 +45,10 @@ const schema = createMetaFormSchema({ newPassword: metaFormFieldSchema .string() .min(6, t('密码不能低于6位')) + .matches(/[A-Z]/, '密码必须包含大写字母') + .matches(/[a-z]/, '密码必须包含小写字母') + .matches(/\d/, '密码必须包含数字') + .matches(/[`~!@#$%^&*()_+./,;':"*]/, '密码必须包含符号') .required(t('密码不能为空')), newPasswordRepeat: metaFormFieldSchema .string()