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() 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 && (