Pārlūkot izejas kodu

fix: 修复销售经理权限验证不通过的问题

suntg 6 gadi atpakaļ
vecāks
revīzija
fffdfc7d73

+ 1 - 1
src/main/java/com/uas/platform/b2b/filter/SSOInterceptor.java

@@ -418,7 +418,7 @@ public class SSOInterceptor extends B2bAbstractSSOInterceptor {
 				}
 			}
 		}
-		// 验证是否是当前企业管理员
+		// 验证是否是当前企业管理员或者销售经理
 		for (Role role : user.getRoles()) {
 			if (user.getEnterprise().getUu().intValue() == role.getEnUU().intValue() && role.isSys()) {
 				SystemSession.getUser().setIssys(Constant.YES);

+ 1 - 1
src/main/java/com/uas/platform/b2b/model/Role.java

@@ -179,7 +179,7 @@ public class Role implements Serializable {
 	@JsonIgnore
 	@JSONField(serialize = false)
 	public boolean isSys() {
-		return getIssys() != null && getIssys() == Constant.YES;
+		return getIssys() != null && (getIssys() == Constant.YES || "ROLE_SALEMANAGER".equals(this.name));
 	}
 
 	public String getDuty() {

+ 1 - 1
src/main/java/com/uas/platform/b2b/service/impl/UserServiceImpl.java

@@ -806,7 +806,7 @@ public class UserServiceImpl implements UserService {
 		Set<Role> roles = SystemSession.getUser().getRoles();
 		boolean isSys = false;
 		for (Role role : roles) {
-			if (role.getIssys() == 1 || "ROLE_SALEMANAGER".equals(role.getName())) {
+			if (role.isSys()) {
 				isSys = true;
 				break;
 			}