Skip to content

Commit 0d27c85

Browse files
committed
fix(identity-service): 修复多个角色情况下,出现重复菜单
1 parent 707c8dd commit 0d27c85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/identity-service/src/main/java/com/plumdo/identity/repository/MenuRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface MenuRepository extends BaseRepository<Menu, Integer> {
3030
* @param userId
3131
* @return
3232
*/
33-
@Query("select a from Menu a, RoleMenu b, UserRole c where a.id = b.menuId and b.roleId = c.roleId and a.status=" + TableConstant.MENU_STATUS_NORMAL + " and c.userId = ?1 order by a.order asc")
33+
@Query("select distinct a from Menu a, RoleMenu b, UserRole c where a.id = b.menuId and b.roleId = c.roleId and a.status=" + TableConstant.MENU_STATUS_NORMAL + " and c.userId = ?1 order by a.order asc")
3434
List<Menu> findByUserId(int userId);
3535

3636
/**

0 commit comments

Comments
 (0)