Skip to content
This repository has been archived by the owner on Apr 10, 2022. It is now read-only.

Commit

Permalink
路径跳转编码,防止乱码
Browse files Browse the repository at this point in the history
  • Loading branch information
xiandanin committed May 8, 2019
1 parent 7de7b49 commit d6be4cd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public String getPathBySort(String sortType, MagnetRulePath rulePaths) {
return rulePaths.getTime();
} else if (MagnetPageSiteSort.SORT_OPTION_DEFAULT.equals(sortType)) {
return rulePaths.getPreset();
}else{
} else {
return getSupportedSorts(rulePaths).get(0).getSort();
}
}
Expand All @@ -139,7 +139,10 @@ private Map<String, MagnetRule> getMagnetRule() {
sites.add(rule);
log.append("[加载]--->" + rule.getSite() + " : " + rule.getUrl() + "\n");
}
log.append(magnetRuleMap.size() + "个网站规则加载完成");
log.append(rules.size());
log.append("个网站规则加载完成,忽略");
log.append(rules.size() - magnetRuleMap.size());
log.append("个");
logger.info(log.toString());
}
return magnetRuleMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public List<MagnetItem> parser(MagnetRule rule, String keyword, String sort, int
String url = String.format("%s%s", rule.getUrl(), sortPath);

Connection connect = Jsoup.connect(url)
.ignoreContentType(true)
.sslSocketFactory(DefaultSslSocketFactory.getDefaultSslSocketFactory())
.timeout(15000);
Map<String, String> cookies = mCacheCookies.get(rule.getUrl());
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/WEB-INF/views/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
if (this.current.keyword != null && this.current.keyword.length > 0) {
keywordString = "&k=" + this.current.keyword + "&s=" + this.current.sort + "&p=" + this.current.page;
}
return "?source=" + encodeURI(this.current.site + keywordString);
},
redirectCurrentURL() {
window.location.href = "search" + this.getParamsString()
Expand Down

1 comment on commit d6be4cd

@xiandanin
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix #16

Please sign in to comment.