成员管理的基础

This commit is contained in:
2022-02-15 10:14:52 +08:00
parent 2122a0b079
commit a831b65a5f
3 changed files with 344 additions and 222 deletions

View File

@@ -117,9 +117,10 @@ const getGroupBase = (groupId) => {
})
}
const getGroupUsers = (groupId) => {
const getGroupUsers = (groupId, limit) => {
limit = limit || 0
return request({
url: 'im/groups/' + groupId + '/users'
url: 'im/groups/' + groupId + '/users?limit=' + limit
})
}
@@ -210,6 +211,59 @@ const dismissGroup = (groupId) => {
})
}
/**
* 移除群成员
*/
const removeGroupUser = (groupId, userId) => {
return request({
method: 'DELETE',
url: 'im/groups/' + groupId + '/users/' + userId
})
}
/**
* 邀请群成员
*/
const inviteGroupUser = (groupId, userIds) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/invite',
data: {
userIds
}
})
}
/**
* 设置群管理
*/
const setGroupAdmin = (groupId, userId) => {
return request({
method: 'POST',
url: 'im/groups/' + groupId + '/admin/' + userId
})
}
/**
* 移除群管理
*/
const removeGroupAdmin = (groupId, userId) => {
return request({
method: 'DELETE',
url: 'im/groups/' + groupId + '/admin/' + userId
})
}
/**
* 转移群主
*/
const transferGroupOwner = (groupId, userId) => {
return request({
method: 'DELETE',
url: 'im/groups/' + groupId + '/owner/' + userId
})
}
export {
getImToken,
deleteFriend,
@@ -235,5 +289,10 @@ export {
joinGroupPre,
joinGroup,
quitGroup,
dismissGroup
dismissGroup,
inviteGroupUser,
removeGroupUser,
setGroupAdmin,
removeGroupAdmin,
transferGroupOwner
}