| | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collector; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | |
| | | return R.status(roleService.submit(role)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | |
| | | public R grant(@RequestBody GrantVO grantVO) { |
| | | CacheUtil.clear(SYS_CACHE); |
| | | CacheUtil.clear(SYS_CACHE, Boolean.FALSE); |
| | | boolean temp = roleService.grant(grantVO.getRoleIds(), grantVO.getMenuIds(), grantVO.getDataScopeIds(), grantVO.getApiScopeIds()); |
| | | boolean temp = false; |
| | | try { |
| | | temp = roleService.grant(grantVO.getRoleIds(), grantVO.getMenuIds(), grantVO.getDataScopeIds(), grantVO.getApiScopeIds()); |
| | | // 插入授权日志 |
| | | roleService.grantLog(roleService.getGrantRoleResString(grantVO.getRoleIds()),false); |
| | | }catch (Exception e){ |
| | | // 失败时插入异常信息到日志中 |
| | | roleService.grantLog(e.getMessage(),true); |
| | | throw e; |
| | | } |
| | | return R.status(temp); |
| | | } |
| | | |