fix 修复 授权角色空数据问题

master
疯狂的狮子li 4 years ago
parent 90d4fd8cf1
commit b7f6f73342

@ -364,13 +364,17 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
@Override
public int insertAuthUsers(Long roleId, Long[] userIds) {
// 新增用户与角色管理
List<SysUserRole> list = new ArrayList<SysUserRole>();
int rows = 1;
List<SysUserRole> list = new ArrayList<SysUserRole>();
for (Long userId : userIds) {
SysUserRole ur = new SysUserRole();
ur.setUserId(userId);
ur.setRoleId(roleId);
list.add(ur);
}
return userRoleMapper.insertAll(list);
if (list.size() > 0) {
rows = userRoleMapper.insertAll(list);
}
return rows;
}
}

Loading…
Cancel
Save