Skip to content

Commit

Permalink
修复外链带端口出现的异常(I86J4B)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzongzhuan committed Nov 7, 2023
1 parent 9bcc193 commit d4cc75b
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SysMenuServiceImpl implements ISysMenuService

@Autowired
private SysMenuMapper menuMapper;

@Autowired
private SysRoleMapper roleMapper;

Expand Down Expand Up @@ -175,7 +175,7 @@ public List<RouterVo> buildMenus(List<SysMenu> menus)
router.setQuery(menu.getQuery());
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
List<SysMenu> cMenus = menu.getChildren();
if (!cMenus.isEmpty() && cMenus.size() > 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType()))
{
router.setAlwaysShow(true);
router.setRedirect("noRedirect");
Expand Down Expand Up @@ -223,11 +223,7 @@ else if (menu.getParentId().intValue() == 0 && isInnerLink(menu))
public List<SysMenu> buildMenuTree(List<SysMenu> menus)
{
List<SysMenu> returnList = new ArrayList<SysMenu>();
List<Long> tempList = new ArrayList<Long>();
for (SysMenu dept : menus)
{
tempList.add(dept.getMenuId());
}
List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList());
for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();)
{
SysMenu menu = (SysMenu) iterator.next();
Expand Down Expand Up @@ -479,8 +475,8 @@ public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId)
/**
* 递归列表
*
* @param list
* @param t
* @param list 分类表
* @param t 子节点
*/
private void recursionFn(List<SysMenu> list, SysMenu t)
{
Expand Down Expand Up @@ -525,11 +521,11 @@ private boolean hasChild(List<SysMenu> list, SysMenu t)
/**
* 内链域名特殊字符替换
*
* @return
* @return 替换后的内链域名
*/
public String innerLinkReplaceEach(String path)
{
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." },
new String[] { "", "", "", "/" });
return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":" },
new String[] { "", "", "", "/", "/" });
}
}

0 comments on commit d4cc75b

Please sign in to comment.