From 7bdb327605f0604b9e31338bf950ebc817bc8607 Mon Sep 17 00:00:00 2001 From: wayn <1669738430@qq.com> Date: Sat, 5 Aug 2023 18:16:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=95=86=E5=9F=8E):=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/LoginController.java | 8 +-- .../framework/config/SecurityConfig.java | 17 ----- .../security/service/LoginService.java | 2 +- .../security/service/PermissionService.java | 68 ++++++++++++++----- .../service/SysPermissionService.java | 55 --------------- .../service/UserDetailsServiceImpl.java | 13 +++- .../wayn/common/constant/SysConstants.java | 17 +++++ .../wayn/common/core/domain/system/Role.java | 8 ++- .../wayn/common/core/domain/system/User.java | 1 + .../common/core/mapper/system/MenuMapper.java | 2 + .../common/core/mapper/system/RoleMapper.java | 3 + .../core/service/system/IMenuService.java | 4 +- .../core/service/system/IRoleService.java | 3 + .../service/system/impl/MenuServiceImpl.java | 4 +- .../service/system/impl/RoleServiceImpl.java | 6 ++ .../common/exception/BusinessException.java | 8 +++ .../exception/GlobalExceptionHandler.java | 4 +- .../resources/mapper/system/MenuMapper.xml | 9 +++ .../resources/mapper/system/RoleMapper.xml | 10 ++- 19 files changed, 134 insertions(+), 108 deletions(-) delete mode 100644 waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/SysPermissionService.java diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/system/LoginController.java b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/system/LoginController.java index aae3136..954c270 100644 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/system/LoginController.java +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/api/controller/system/LoginController.java @@ -1,7 +1,7 @@ package com.wayn.admin.api.controller.system; import com.wayn.admin.framework.security.service.LoginService; -import com.wayn.admin.framework.security.service.SysPermissionService; +import com.wayn.admin.framework.security.service.PermissionService; import com.wayn.admin.framework.security.service.TokenService; import com.wayn.common.constant.SysConstants; import com.wayn.common.core.domain.system.Menu; @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; public class LoginController { private LoginService loginService; private TokenService tokenService; - private SysPermissionService sysPermissionService; + private PermissionService permissionService; private IMenuService iMenuService; private RedisCache redisCache; @@ -60,8 +60,8 @@ public class LoginController { R success = R.success(); LoginUserDetail loginUser = tokenService.getLoginUser(request); User user = loginUser.getUser(); - Set rolePermission = sysPermissionService.getRolePermission(user); - Set menuPermission = sysPermissionService.getMenuPermission(user); + Set rolePermission = permissionService.getRolePermission(user); + Set menuPermission = permissionService.getMenuPermission(rolePermission); success.add("user", user); success.add("roles", rolePermission); success.add("permissions", menuPermission); diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/config/SecurityConfig.java b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/config/SecurityConfig.java index 2fb4d7f..bda5bc7 100644 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/config/SecurityConfig.java +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/config/SecurityConfig.java @@ -18,9 +18,6 @@ import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.CorsConfigurationSource; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; @Configuration @EnableWebSecurity @@ -98,18 +95,4 @@ public class SecurityConfig { public BCryptPasswordEncoder bCryptPasswordEncoder() { return new BCryptPasswordEncoder(); } - - - @Bean - public CorsConfigurationSource corsConfigurationSource() { - CorsConfiguration corsConfiguration = new CorsConfiguration(); - corsConfiguration.addAllowedOriginPattern("*"); - corsConfiguration.addAllowedHeader("*"); - corsConfiguration.addAllowedMethod("*"); - corsConfiguration.setAllowCredentials(true); - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - source.registerCorsConfiguration("/**", corsConfiguration); - return source; - } - } diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/LoginService.java b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/LoginService.java index db3b2d7..b1c55e9 100644 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/LoginService.java +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/LoginService.java @@ -33,7 +33,7 @@ public class LoginService { if (e instanceof BadCredentialsException) { throw new BadCredentialsException(e.getMessage(), e); } else { - throw new BusinessException(e.getMessage()); + throw new BusinessException(e.getMessage(), e); } } LoginUserDetail principal = (LoginUserDetail) authentication.getPrincipal(); diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/PermissionService.java b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/PermissionService.java index e8c05ae..1097db3 100644 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/PermissionService.java +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/PermissionService.java @@ -1,34 +1,29 @@ package com.wayn.admin.framework.security.service; +import com.wayn.common.constant.SysConstants; import com.wayn.common.core.domain.system.Role; +import com.wayn.common.core.domain.system.User; import com.wayn.common.core.model.LoginUserDetail; +import com.wayn.common.core.service.system.IMenuService; +import com.wayn.common.core.service.system.IRoleService; +import com.wayn.common.core.service.system.IUserService; import com.wayn.common.util.ServletUtils; import lombok.AllArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.util.HashSet; import java.util.Objects; import java.util.Set; @Service("ss") @AllArgsConstructor public class PermissionService { - /** - * 所有权限标识 - */ - private static final String ALL_PERMISSION = "*:*:*"; - - /** - * 管理员角色权限标识 - */ - private static final String SUPER_ADMIN = "admin"; - - private static final String ROLE_DELIMETER = ","; - - private static final String PERMISSION_DELIMETER = ","; - private TokenService tokenService; + private IUserService userService; + private IRoleService roleService; + private IMenuService menuService; /** * 验证用户是否具备某权限 @@ -72,7 +67,7 @@ public class PermissionService { return false; } Set authorities = loginUser.getPermissions(); - for (String permission : permissions.split(PERMISSION_DELIMETER)) { + for (String permission : permissions.split(SysConstants.PERMISSION_DELIMETER)) { if (permission != null && hasPermissions(authorities, permission)) { return true; } @@ -96,7 +91,7 @@ public class PermissionService { } for (Role sysRole : loginUser.getUser().getRoles()) { String roleKey = sysRole.getRoleKey(); - if (SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role))) { + if (SysConstants.SUPER_ADMIN.contains(roleKey) || roleKey.contains(StringUtils.trim(role))) { return true; } } @@ -127,7 +122,7 @@ public class PermissionService { if (Objects.isNull(loginUser) || CollectionUtils.isEmpty(loginUser.getUser().getRoles())) { return false; } - for (String role : roles.split(ROLE_DELIMETER)) { + for (String role : roles.split(SysConstants.ROLE_DELIMETER)) { if (hasRole(role)) { return true; } @@ -143,6 +138,43 @@ public class PermissionService { * @return 用户是否具备某权限 */ private boolean hasPermissions(Set permissions, String permission) { - return permissions.contains(ALL_PERMISSION) || permissions.contains(StringUtils.trim(permission)); + return permissions.contains(SysConstants.ALL_PERMISSION) + || permissions.contains(StringUtils.trim(permission)); + } + + /** + * 获取角色数据权限 + * + * @param user 用户信息 + * @return 角色权限信息 + */ + public Set getRolePermission(User user) { + Set roles = new HashSet<>(); + // 管理员拥有所有权限 + if (user.isAdmin()) { + roles.add("admin"); + } else { + roles.addAll(roleService.selectRoleKeyByUserId(user.getUserId())); + } + return roles; + } + + /** + * 获取菜单数据权限 + * + * @param roleKeys 角色信息 + * @return 菜单权限信息 + */ + public Set getMenuPermission(Set roleKeys) { + Set perms = new HashSet<>(); + // 管理员拥有所有权限 + if (roleKeys.contains(SysConstants.SUPER_ADMIN)) { + perms.add("*:*:*"); + } else { + for (String roleKey : roleKeys) { + perms.addAll(menuService.selectMenuPermsByRoleKey(roleKey)); + } + } + return perms; } } diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/SysPermissionService.java b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/SysPermissionService.java deleted file mode 100644 index 3768ecb..0000000 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/SysPermissionService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.wayn.admin.framework.security.service; - -import com.wayn.common.core.domain.system.User; -import com.wayn.common.core.service.system.IMenuService; -import com.wayn.common.core.service.system.IRoleService; -import lombok.AllArgsConstructor; -import org.springframework.stereotype.Component; - -import java.util.HashSet; -import java.util.Set; - -/** - * 用户权限处理 - */ -@Component -@AllArgsConstructor -public class SysPermissionService { - private IRoleService roleService; - - private IMenuService menuService; - - /** - * 获取角色数据权限 - * - * @param user 用户信息 - * @return 角色权限信息 - */ - public Set getRolePermission(User user) { - Set roles = new HashSet<>(); - // 管理员拥有所有权限 - if (user.isAdmin()) { - roles.add("admin"); - } else { - roles.addAll(roleService.selectRoleByUserId(user.getUserId())); - } - return roles; - } - - /** - * 获取菜单数据权限 - * - * @param user 用户信息 - * @return 菜单权限信息 - */ - public Set getMenuPermission(User user) { - Set perms = new HashSet<>(); - // 管理员拥有所有权限 - if (user.isAdmin()) { - perms.add("*:*:*"); - } else { - perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); - } - return perms; - } -} diff --git a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/UserDetailsServiceImpl.java b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/UserDetailsServiceImpl.java index d9c1994..ab31b7e 100644 --- a/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/UserDetailsServiceImpl.java +++ b/waynboot-admin-api/src/main/java/com/wayn/admin/framework/security/service/UserDetailsServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.stereotype.Service; import java.util.Objects; +import java.util.Set; @Slf4j @Service @@ -26,7 +27,7 @@ public class UserDetailsServiceImpl implements UserDetailsService { private IDeptService iDeptService; - private SysPermissionService permissionService; + private PermissionService permissionService; public static void main(String[] args) { BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder(); @@ -35,17 +36,23 @@ public class UserDetailsServiceImpl implements UserDetailsService { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + // 1. 读取数据库中当前用户信息 User user = iUserService.getOne(new QueryWrapper().eq("user_name", username)); + // 2. 判断该用户是否存在 if (user == null) { log.info("登录用户:{} 不存在.", username); throw new UsernameNotFoundException("登录用户:" + username + " 不存在"); } + // 3. 判断是否禁用 if (Objects.equals(UserStatusEnum.DISABLE.getCode(), user.getUserStatus())) { log.info("登录用户:{} 已经被停用.", username); throw new DisabledException("登录用户:" + username + " 不存在"); } user.setDept(iDeptService.getById(user.getDeptId())); - return new LoginUserDetail(user, permissionService.getMenuPermission(user)); + // 4. 获取当前用户的角色信息 + Set rolePermission = permissionService.getRolePermission(user); + // 5. 根据角色获取权限信息 + Set menuPermission = permissionService.getMenuPermission(rolePermission); + return new LoginUserDetail(user, menuPermission); } - } diff --git a/waynboot-common/src/main/java/com/wayn/common/constant/SysConstants.java b/waynboot-common/src/main/java/com/wayn/common/constant/SysConstants.java index 46ff306..8283299 100644 --- a/waynboot-common/src/main/java/com/wayn/common/constant/SysConstants.java +++ b/waynboot-common/src/main/java/com/wayn/common/constant/SysConstants.java @@ -37,6 +37,23 @@ public class SysConstants { */ public static final String TOKEN_PREFIX = "Bearer "; + // ------------------------------------------------ 角色常量 ------------------------------------------------------------------------ + + /** + * 所有权限标识 + */ + public static final String ALL_PERMISSION = "*:*:*"; + + /** + * 管理员角色权限标识 + */ + public static final String SUPER_ADMIN = "admin"; + + public static final String ROLE_DELIMETER = ","; + + public static final String PERMISSION_DELIMETER = ","; + + // ------------------------------------------------ 菜单常量 ------------------------------------------------------------------------ /** * 类型(M目录 C菜单 F按钮) diff --git a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/Role.java b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/Role.java index 9c0d2fc..1d109ba 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/Role.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/Role.java @@ -6,11 +6,13 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.wayn.common.base.entity.BaseEntity; +import com.wayn.common.constant.SysConstants; import com.wayn.common.enums.domain.StatusConverter; import jakarta.validation.constraints.DecimalMin; import jakarta.validation.constraints.NotBlank; import lombok.Data; import lombok.EqualsAndHashCode; +import org.apache.commons.lang3.StringUtils; import java.io.Serial; import java.util.List; @@ -78,12 +80,12 @@ public class Role extends BaseEntity { } - public static boolean isAdmin(Long roleId) { - return roleId != null && 1L == roleId; + public static boolean isAdmin(String roleKey) { + return StringUtils.isNotBlank(roleKey) && SysConstants.SUPER_ADMIN.equals(roleKey); } public boolean isAdmin() { - return isAdmin(this.roleId); + return isAdmin(this.roleKey); } } diff --git a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/User.java b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/User.java index b718e41..e23969f 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/domain/system/User.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/domain/system/User.java @@ -17,6 +17,7 @@ import lombok.EqualsAndHashCode; import java.io.Serial; import java.util.List; +import java.util.Set; /** * 用户表 sys_user diff --git a/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/MenuMapper.java b/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/MenuMapper.java index dd8e885..22e3d53 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/MenuMapper.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/MenuMapper.java @@ -15,4 +15,6 @@ public interface MenuMapper extends BaseMapper { List selectMenuListByUserId(Menu menu, Long userId); List selectMenuList(Menu menu); + + List selectMenuPermsByRoleKey(String roleKey); } diff --git a/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/RoleMapper.java b/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/RoleMapper.java index f912d64..f5297ce 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/RoleMapper.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/mapper/system/RoleMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.wayn.common.core.domain.system.Role; +import java.util.Collection; import java.util.List; public interface RoleMapper extends BaseMapper { @@ -18,4 +19,6 @@ public interface RoleMapper extends BaseMapper { List selectRoleList(Role role); List selectRolesByUserName(String userName); + + Collection selectRoleKeyByUserId(Long userId); } diff --git a/waynboot-common/src/main/java/com/wayn/common/core/service/system/IMenuService.java b/waynboot-common/src/main/java/com/wayn/common/core/service/system/IMenuService.java index 2d17e73..95f459e 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/service/system/IMenuService.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/service/system/IMenuService.java @@ -18,12 +18,12 @@ public interface IMenuService extends IService { List list(Menu menu); /** - * 根据用户id查询权限 + * 根据角色key查询权限 * * @param userId * @return 权限列表 */ - List selectMenuPermsByUserId(Long userId); + List selectMenuPermsByRoleKey(String roleKey); /** * 根据用户id查询菜单树 diff --git a/waynboot-common/src/main/java/com/wayn/common/core/service/system/IRoleService.java b/waynboot-common/src/main/java/com/wayn/common/core/service/system/IRoleService.java index ce703b0..6db1737 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/service/system/IRoleService.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/service/system/IRoleService.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.wayn.common.core.domain.system.Role; +import java.util.Collection; import java.util.List; public interface IRoleService extends IService { @@ -95,4 +96,6 @@ public interface IRoleService extends IService { * @return int */ long countUserRoleByRoleId(Long roleId); + + Collection selectRoleKeyByUserId(Long userId); } diff --git a/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/MenuServiceImpl.java b/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/MenuServiceImpl.java index c8555aa..b738792 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/MenuServiceImpl.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/MenuServiceImpl.java @@ -37,8 +37,8 @@ public class MenuServiceImpl extends ServiceImpl implements IM } @Override - public List selectMenuPermsByUserId(Long userId) { - return menuMapper.selectMenuPermsByUserId(userId); + public List selectMenuPermsByRoleKey(String roleKey) { + return menuMapper.selectMenuPermsByRoleKey(roleKey); } @Override diff --git a/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/RoleServiceImpl.java b/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/RoleServiceImpl.java index 402aef3..5919231 100644 --- a/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/RoleServiceImpl.java +++ b/waynboot-common/src/main/java/com/wayn/common/core/service/system/impl/RoleServiceImpl.java @@ -18,6 +18,7 @@ import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Collection; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -103,6 +104,11 @@ public class RoleServiceImpl extends ServiceImpl implements IR return iUserRoleService.count(Wrappers.lambdaQuery(UserRole.class).eq(UserRole::getRoleId, roleId)); } + @Override + public Collection selectRoleKeyByUserId(Long userId) { + return roleMapper.selectRoleKeyByUserId(userId); + } + @Override public IPage listPage(Page page, Role role) { return roleMapper.selectRoleListPage(page, role); diff --git a/waynboot-common/src/main/java/com/wayn/common/exception/BusinessException.java b/waynboot-common/src/main/java/com/wayn/common/exception/BusinessException.java index 50eeb67..a2fb624 100644 --- a/waynboot-common/src/main/java/com/wayn/common/exception/BusinessException.java +++ b/waynboot-common/src/main/java/com/wayn/common/exception/BusinessException.java @@ -3,6 +3,7 @@ package com.wayn.common.exception; import com.wayn.common.enums.ReturnCodeEnum; import lombok.Data; import lombok.EqualsAndHashCode; +import org.elasticsearch.client.ml.SetUpgradeModeRequest; import java.io.Serial; @@ -20,12 +21,19 @@ public class BusinessException extends RuntimeException { private String msg; public BusinessException(ReturnCodeEnum returnCodeEnum) { + super(returnCodeEnum.getMsg()); this.code = returnCodeEnum.getCode(); this.msg = returnCodeEnum.getMsg(); } public BusinessException(String msg) { + super(msg); this.msg = msg; this.code = ReturnCodeEnum.CUSTOM_ERROR.getCode(); } + + + public BusinessException(String message, Throwable cause) { + super(message, cause); + } } diff --git a/waynboot-common/src/main/java/com/wayn/common/exception/GlobalExceptionHandler.java b/waynboot-common/src/main/java/com/wayn/common/exception/GlobalExceptionHandler.java index 170c239..33d34e8 100644 --- a/waynboot-common/src/main/java/com/wayn/common/exception/GlobalExceptionHandler.java +++ b/waynboot-common/src/main/java/com/wayn/common/exception/GlobalExceptionHandler.java @@ -28,9 +28,9 @@ public class GlobalExceptionHandler { public R businessException(BusinessException e) { log.error(e.getMessage(), e); if (Objects.isNull(e.getCode())) { - return R.error(ReturnCodeEnum.CUSTOM_ERROR.setMsg(e.getMessage())); + return R.error(ReturnCodeEnum.CUSTOM_ERROR.setMsg(e.getMsg())); } - return R.error(e.getCode(), e.getMessage()); + return R.error(e.getCode(), e.getMsg()); } /** diff --git a/waynboot-common/src/main/resources/mapper/system/MenuMapper.xml b/waynboot-common/src/main/resources/mapper/system/MenuMapper.xml index a57ddb3..0523a5f 100644 --- a/waynboot-common/src/main/resources/mapper/system/MenuMapper.xml +++ b/waynboot-common/src/main/resources/mapper/system/MenuMapper.xml @@ -78,4 +78,13 @@ order by m.parent_id, m.sort + + diff --git a/waynboot-common/src/main/resources/mapper/system/RoleMapper.xml b/waynboot-common/src/main/resources/mapper/system/RoleMapper.xml index e77f7d0..3057e72 100644 --- a/waynboot-common/src/main/resources/mapper/system/RoleMapper.xml +++ b/waynboot-common/src/main/resources/mapper/system/RoleMapper.xml @@ -81,4 +81,12 @@ WHERE r.del_flag = 0 and u.user_name = #{userName} - \ No newline at end of file + + +