再从后端获取一次角色类型,防止前端关闭了缓存功能

This commit is contained in:
季圣华
2023-03-29 22:34:22 +08:00
parent 21ae3e8a21
commit 5bfc6f24bb
2 changed files with 8 additions and 0 deletions

View File

@@ -144,6 +144,10 @@ public class AccountHeadService {
private String[] getCreatorArray(String roleType) throws Exception {
String creator = "";
User user = userService.getCurrentUser();
//再从后端获取一次角色类型,防止前端关闭了缓存功能
if(StringUtil.isEmpty(roleType)) {
roleType = userService.getRoleTypeByUserId(user.getId()).getType(); //角色类型
}
if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) {
creator = user.getId().toString();
} else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) {

View File

@@ -294,6 +294,10 @@ public class DepotHeadService {
public String getCreatorByRoleType(String roleType) throws Exception {
String creator = "";
User user = userService.getCurrentUser();
//再从后端获取一次角色类型,防止前端关闭了缓存功能
if(StringUtil.isEmpty(roleType)) {
roleType = userService.getRoleTypeByUserId(user.getId()).getType(); //角色类型
}
if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) {
creator = user.getId().toString();
} else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) {