Merge branch 'feature-nxdev' of https://gitea.nxsir.cn/code/IM into feature-nxdev

This commit is contained in:
2026-03-09 14:44:37 +08:00
5 changed files with 48 additions and 3 deletions
@@ -79,6 +79,10 @@ import { MESSAGE_TYPE } from '../../constants/MessageType';
import feather from 'feather-icons';
import { GROUP_MEMBER_ROLE } from '../../constants/GroupDefine';
import { uploadService } from '../../services/upload/uploadService';
import { groupService } from '../../services/group';
import { SYSTEM_BASE_STATUS } from '../../constants/systemBaseStatus';
import { useMessage } from './useAlert';
import { getFileHash } from '../../utils/uploadTools';
const props = defineProps({
chatType: {
@@ -105,6 +109,8 @@ const props = defineProps({
const input = useTemplateRef('input')
const message = useMessage();
defineEmits(['close', 'viewAll']);
const uploadGroupAvatar = () => {
@@ -113,7 +119,17 @@ const uploadGroupAvatar = () => {
const fileUploadHandler = async (e) => {
const file = e.target.files[0];
const { data } = await uploadService.uploadSmallFile(file);
const hash = getFileHash(file)
const { data } = await uploadService.uploadSmallFile(file, hash);
const res = await groupService.updateGroupInfo(props.groupData.targetId, {
avatar: data.url
})
if(res.code == SYSTEM_BASE_STATUS.SUCCESS){
message.success('头像更新成功')
}else{
message.error(res.message)
}
}
// 判断当前用户是否为管理员
@@ -12,5 +12,14 @@ export const groupService = {
* @param {*} groupId
* @returns
*/
getGroupMember: (groupId) => request.get(`/Group/GetGroupMembers?groupId=${groupId}`)
getGroupMember: (groupId) => request.get(`/Group/GetGroupMembers?groupId=${groupId}`),
/**
* 更新群组信息
* @param {*} groupId
* @param {*} params
* @returns
*/
updateGroupInfo: (groupId, params) => request.post(`/Group/UpdateGroup?groupId=${groupId}`, params)
}