修改添加成员接口
This commit is contained in:
@@ -99,10 +99,11 @@ export function updateUserSalaryConfig(data) {
|
||||
}
|
||||
|
||||
// 添加用户到组
|
||||
export function addUserToGroup(groupId, userid, role) {
|
||||
export function addUserToGroup(data) {
|
||||
return service({
|
||||
url: `/group/${groupId}/user/${userid}/role/${role}`,
|
||||
method: 'post'
|
||||
url: '/group/user',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -569,10 +569,14 @@ const fetchNonGroupUsers = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 修改添加用户到组的函数
|
||||
// 添加用户到组
|
||||
const handleAddToGroup = async (user) => {
|
||||
try {
|
||||
const res = await addUserToGroup(currentGroup.value.groupId, user.userid, ["0"]); // 默认角色为普通员工
|
||||
const res = await addUserToGroup({
|
||||
groupId: currentGroup.value.groupId,
|
||||
userid: user.userid,
|
||||
roles: ["0"] // 默认角色为普通员工
|
||||
});
|
||||
if (res.errcode === 0) {
|
||||
ElMessage.success("添加成功");
|
||||
addUserDialogVisible.value = false;
|
||||
|
||||
Reference in New Issue
Block a user