@@ -65,9 +65,7 @@ public class PortalSaveReqVO {
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "权限标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "portal:purchase:access")
|
||||
@NotEmpty(message = "权限标识不能为空")
|
||||
@Size(max = 100, message = "权限标识长度不能超过100个字符")
|
||||
@Pattern(regexp = "^portal:[a-z]+:access$", message = "权限标识格式不正确,应为 portal:{module}:access")
|
||||
private String permission;
|
||||
|
||||
@Schema(description = "打开方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
|
||||
@@ -16,6 +16,7 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -50,7 +51,7 @@ public class PortalServiceImpl implements PortalService {
|
||||
portalMapper.insert(portal);
|
||||
|
||||
// 2. 自动创建对应的菜单权限
|
||||
if (createReqVO.getParentMenuId() != null) {
|
||||
if (createReqVO.getParentMenuId() != null&& StringUtils.hasText(createReqVO.getPermission())) {
|
||||
syncMenuPermission(portal, createReqVO.getParentMenuId(), null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user