优化:日志输出重构 (#689)

This commit is contained in:
kl
2025-10-13 11:14:54 +08:00
committed by GitHub
parent 421640221b
commit b1af0c7d72
14 changed files with 65 additions and 29 deletions

View File

@@ -87,7 +87,7 @@ public class WebUtils {
try {
urlStr = URLEncoder.encode(urlStr, "UTF-8").replaceAll("\\+", "%20").replaceAll("%3A", ":").replaceAll("%2F", "/").replaceAll("%3F", "?").replaceAll("%26", "&").replaceAll("%3D", "=");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
LOGGER.error("Failed to encode URL: {}", urlStr, e);
}
}
return urlStr;
@@ -155,7 +155,7 @@ public class WebUtils {
URL urlObj = new URL(url);
url = urlObj.getPath().substring(1);
} catch (MalformedURLException e) {
e.printStackTrace();
LOGGER.error("Failed to parse file URL: {}", url, e);
}
}
// 因为url的参数中可能会存在/的情况所以直接url.lastIndexOf("/")会有问题