diff --git a/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java b/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java index 133b633..153f9cf 100644 --- a/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java +++ b/cloud-common/src/main/java/com/cm/common/component/SecurityComponent.java @@ -40,6 +40,7 @@ public class SecurityComponent { UserBO userBO = (UserBO) user; userInfoBO.setUserId(userBO.getUserId()); userInfoBO.setUserUsername(userBO.getUsername()); + userInfoBO.setUserName(userBO.getUserName()); userInfoBO.setUserPhone(userBO.getUserPhone()); userInfoBO.setDataAuthority(userBO.getDataAuthority()); userInfoBO.setDataAuthorityUserIds(userBO.getDataAuthorityUserIds()); diff --git a/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java b/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java index becc291..8d9d760 100644 --- a/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java +++ b/cloud-common/src/main/java/com/cm/common/constants/ISystemConstant.java @@ -20,6 +20,10 @@ public interface ISystemConstant { * APP接口前缀 */ String API_TAGS_APP_PREFIX = "APP接口-"; + /** + * APP路由接口前缀 + */ + String API_TAGS_APP_ROUTE_PREFIX = "APP路由接口-"; /** * 路由接口前缀 */ @@ -40,6 +44,14 @@ public interface ISystemConstant { * APP前缀 */ String APP_PREFIX = "/app"; + /** + * APP路由前缀 + */ + String APP_ROUTE_PREFIX = "/approute"; + /** + * APP放行后缀 + */ + String APP_RELEASE_SUFFIX = "release"; /** * true */ diff --git a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java index 1790ddd..2d5951e 100644 --- a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java +++ b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserBO.java @@ -3,6 +3,7 @@ package com.cm.common.pojo.bos; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.User; +import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -85,7 +86,7 @@ public class UserBO extends User { } public List getBaseDepartmentIds() { - return baseDepartmentIds; + return baseDepartmentIds == null ? new ArrayList<>(0) : baseDepartmentIds; } public void setBaseDepartmentIds(List baseDepartmentIds) { @@ -101,7 +102,7 @@ public class UserBO extends User { } public List getDataAuthorityUserIds() { - return dataAuthorityUserIds; + return dataAuthorityUserIds == null ? new ArrayList<>(0) : dataAuthorityUserIds; } public void setDataAuthorityUserIds(List dataAuthorityUserIds) { @@ -109,11 +110,14 @@ public class UserBO extends User { } public List getRoles() { - return roles; + return roles == null ? new ArrayList<>(0) : roles; } public void setRoles(List roles) { this.roles = roles; + if (roles == null || roles.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); roles.forEach(roleBO -> { @@ -128,11 +132,14 @@ public class UserBO extends User { } public List getGroups() { - return groups; + return groups == null ? new ArrayList<>(0) : groups; } public void setGroups(List groups) { this.groups = groups; + if (groups == null || groups.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); groups.forEach(groupBO -> { @@ -147,11 +154,14 @@ public class UserBO extends User { } public List getDepartments() { - return departments; + return departments == null ? new ArrayList<>(0) : departments; } public void setDepartments(List departments) { this.departments = departments; + if (departments == null || departments.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); departments.forEach(departmentBO -> { @@ -166,11 +176,14 @@ public class UserBO extends User { } public List getPositions() { - return positions; + return positions == null ? new ArrayList<>(0) : positions; } public void setPositions(List positions) { this.positions = positions; + if (positions == null || positions.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); positions.forEach(positionBO -> { diff --git a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java index 9dff0c9..0ff6aac 100644 --- a/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java +++ b/cloud-common/src/main/java/com/cm/common/pojo/bos/UserInfoBO.java @@ -69,7 +69,7 @@ public class UserInfoBO { } public List getDataAuthorityUserIds() { - return dataAuthorityUserIds; + return dataAuthorityUserIds == null ? new ArrayList<>(0) : dataAuthorityUserIds; } public void setDataAuthorityUserIds(List dataAuthorityUserIds) { @@ -77,7 +77,7 @@ public class UserInfoBO { } public List getBaseDepartmentIds() { - return baseDepartmentIds; + return baseDepartmentIds == null ? new ArrayList<>(0) : baseDepartmentIds; } public void setBaseDepartmentIds(List baseDepartmentIds) { @@ -90,6 +90,9 @@ public class UserInfoBO { public void setDepartments(List departments) { this.departments = departments; + if (departments == null || departments.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); departments.forEach(departmentBO -> { @@ -109,6 +112,9 @@ public class UserInfoBO { public void setRoles(List roles) { this.roles = roles; + if (roles == null || roles.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); roles.forEach(roleBO -> { @@ -128,6 +134,9 @@ public class UserInfoBO { public void setGroups(List groups) { this.groups = groups; + if (groups == null || groups.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); groups.forEach(groupBO -> { @@ -147,6 +156,9 @@ public class UserInfoBO { public void setPositions(List positions) { this.positions = positions; + if (positions == null || positions.isEmpty()) { + return; + } StringBuilder idSB = new StringBuilder(); StringBuilder nameSB = new StringBuilder(); positions.forEach(positionBO -> {