ソースを参照

fix: 角色编辑

jay 2 年 前
コミット
28824fb4ff

+ 1 - 1
iot-common/iot-common-core/src/main/java/cc/iotkit/common/undefined/RoleDTO.java

@@ -18,7 +18,7 @@ public class RoleDTO implements Serializable {
     /**
      * 角色ID
      */
-    private Long roleId;
+    private Long id;
 
     /**
      * 角色名称

+ 1 - 0
iot-module/iot-system/src/main/java/cc/iotkit/system/controller/SysRoleController.java

@@ -114,6 +114,7 @@ public class SysRoleController extends BaseController {
 
         if (roleService.updateRole(role) > 0) {
             roleService.cleanOnlineUserByRole(role.getId());
+            return;
         }
         fail("修改角色'" + role.getRoleName() + "'失败,请联系管理员");
     }

+ 1 - 1
iot-module/iot-system/src/main/java/cc/iotkit/system/service/impl/SysRoleServiceImpl.java

@@ -414,7 +414,7 @@ public class SysRoleServiceImpl implements ISysRoleService {
                 return;
             }
             LoginUser loginUser = LoginHelper.getLoginUser(token);
-            if (loginUser.getRoles().stream().anyMatch(r -> r.getRoleId().equals(roleId))) {
+            if (loginUser.getRoles().stream().anyMatch(r -> r.getId().equals(roleId))) {
                 try {
                     StpUtil.logoutByTokenValue(token);
                 } catch (NotLoginException ignored) {