From 9b4433fddf5b401edb0aace8a404ac733b122702 Mon Sep 17 00:00:00 2001 From: 田源 <tianyuan@vci-tech.com> Date: 星期四, 03 四月 2025 14:35:02 +0800 Subject: [PATCH] 添加非密字段显示 --- Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java index 6709c7e..7217d10 100644 --- a/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java +++ b/Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/controller/RoleController.java @@ -22,6 +22,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.vci.ubcs.system.cache.NacosConfigCache; import com.vci.ubcs.system.cache.SysCache; +import com.vci.ubcs.system.entity.Menu; import com.vci.ubcs.system.entity.Role; import com.vci.ubcs.system.service.IRoleService; import com.vci.ubcs.system.user.cache.UserCache; @@ -46,6 +47,9 @@ 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; @@ -128,7 +132,6 @@ return R.status(roleService.submit(role)); } - /** * 鍒犻櫎 */ @@ -150,7 +153,16 @@ 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); } -- Gitblit v1.9.3