Merge branch 'dev' of fanxb/bookmark into master

This commit is contained in:
fanxb 2022-04-17 18:41:43 +08:00 committed by Gogs
commit 9e2c75c3ec

View File

@ -404,7 +404,7 @@ public class BookmarkServiceImpl implements BookmarkService {
* @author FleyX
*/
private String saveToFile(String iconUrl, String host, byte[] b) {
String fileName = URLEncoder.encode(host, StandardCharsets.UTF_8) + iconUrl.substring(iconUrl.lastIndexOf("."));
String fileName = host.replace(":", ".") + iconUrl.substring(iconUrl.lastIndexOf("."));
String filePath = Paths.get(FileConstant.FAVICON_PATH, host.replace("www", "").replaceAll("\\.", "").substring(0, 2), fileName).toString();
FileUtil.writeBytes(b, Paths.get(CommonConstant.fileSavePath, filePath).toString());
return File.separator + filePath;