Skip to content

Commit

Permalink
修改目录状态,优化增加的问题.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnobo committed Nov 6, 2023
1 parent 217d046 commit 496e8c7
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

import java.util.List;
import java.util.Optional;
import java.util.Set;

Expand Down Expand Up @@ -57,11 +58,9 @@ public Menu toMenu() {
public Criteria toCriteria() {
Criteria criteria = criteria(Set.of("permissions", "tenantCode", "icons", "menus", "rules"));

Criteria tenantCriteria = Criteria.where("tenantCode").is("0");
if (StringUtils.hasLength(this.getTenantCode())) {
tenantCriteria = tenantCriteria.or("tenantCode").is(this.getTenantCode());
criteria = criteria.and("tenantCode").in(List.of(this.getTenantCode(), "0"));
}
criteria = criteria.and(tenantCriteria);

if (StringUtils.hasLength(this.getAuthority())) {
criteria = criteria.and("authority").is(this.getAuthority());
Expand Down

0 comments on commit 496e8c7

Please sign in to comment.