Browse Source

修改用户接口修改

gao.qiang 1 year ago
parent
commit
0a2b3781ae

+ 7 - 2
base-system/src/main/java/com/ozs/system/service/impl/SysUserServiceImpl.java

@@ -436,8 +436,13 @@ public class SysUserServiceImpl extends JoinServiceImpl<SysUserMapper, SysUser>
      * @param user 用户对象
      */
     public void insertUserRoleUpdate(SysUserUpdate user) {
-        Long [] arr=(Long[]) user.getRoles().stream().map(SysRole::getRoleId).toArray();
-        this.insertUserRole(user.getId(), arr);
+
+        List<Long> collect = user.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
+        Long[] longArray = new Long[collect.size()];
+        for (int i = 0; i < collect.size(); i++) {
+            longArray[i] = collect.get(i);
+        }
+        this.insertUserRole(user.getId(), longArray);
     }
 
     /**