Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Nov 27, 2024
1 parent e3435eb commit db3375e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
22 changes: 22 additions & 0 deletions src/base/FindUrlAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,26 @@ public static List<String> cleanUrls(List<String> urls) {
}
return urls;
}

public static List<String> removeJsUrl(List<String> urls) {

urls = TextUtils.deduplicate(urls);
Iterator<String> it = urls.iterator();
while (it.hasNext()) {
String urlItem = it.next();
// 仅在判断中去除参数和片段
String cleanUrl = urlItem.split("\\?")[0].split("#")[0];

// 判断是否以指定后缀结尾
if (cleanUrl.endsWith(".js") || cleanUrl.endsWith(".vue") || cleanUrl.endsWith(".scss")) {
it.remove();
}

if (cleanUrl.contains("node_modules")) {
it.remove();
}

}
return urls;
}
}
4 changes: 3 additions & 1 deletion src/messageTab/Info/InfoTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ public void setMessage(byte[] content, boolean isRequest) {
protected Void doInBackground() throws Exception {
((InfoPanel) panel).getTable().getInfoTableModel().clear();
List<String> urls = FindUrlAction.findUrls(originContent);


//清除JS\scss\vue等非接口URL
urls = FindUrlAction.removeJsUrl(urls);
for (String url : urls) {
InfoEntry aaa = new InfoEntry(url, InfoEntry.Type_URL);
((InfoPanel) panel).getTable().getInfoTableModel().addNewInfoEntry(aaa);
Expand Down

0 comments on commit db3375e

Please sign in to comment.