1. 123后缀处理 2. 修复缓存时间戳格式问题

This commit is contained in:
qaiu
2024-09-18 15:41:56 +08:00
parent c12e56d402
commit 0d609daffa
4 changed files with 9 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ public class LogStatistics implements AfterInterceptor {
ParserLogInfo parserLogInfo = new ParserLogInfo();
parserLogInfo.setPath(ctx.request().uri());
if (responseData == null) return;
if (responseData.containsKey("code") && responseData.getInteger("code") == 500) {
log.error("code 500: {} {}", ctx.request().path(), responseData.getString("msg"));
} else {

View File

@@ -21,15 +21,18 @@ public class URLParamUtil {
* @return 完整的URL字符串
*/
public static String parserParams(HttpServerRequest request) {
String url = request.absoluteURI();
MultiMap params = request.params();
// 处理URL截断的情况例如: url='https://...&key=...&code=...'
if (params.contains("url")) {
String encodedUrl = params.get("url");
url = handleTruncatedUrl(encodedUrl, params);
if (url.endsWith(".html")) {
// 123云盘的后缀处理
url = url.replace(".html", "");
}
}
return url;
}

View File

@@ -63,7 +63,7 @@ public class CacheServiceImpl implements CacheService {
}
private String generateDate(Long ts) {
return DateFormatUtils.format(new Date(ts), "yyyy-MM-dd hh:mm:ss");
return DateFormatUtils.format(new Date(ts), "yyyy-MM-dd HH:mm:ss");
}
@Override