This commit is contained in:
Leo
2025-11-10 21:49:45 +08:00
parent 5b48727fb2
commit 8e12076225

View File

@@ -211,8 +211,12 @@ public class JDProductService {
String targetUrl = productObj.getString("effectiveUrl");
String normalizedForReplace = productObj.getString("normalizedUrl");
String messageWithShortUrl = message;
if (normalizedForReplace != null && targetUrl != null) {
messageWithShortUrl = message.replace(normalizedForReplace, targetUrl);
if (targetUrl != null) {
String replaced = message.replace(originalUrlInText, targetUrl);
if (replaced.equals(message) && normalizedForReplace != null) {
replaced = replaced.replace(normalizedForReplace, targetUrl);
}
messageWithShortUrl = replaced;
}
commonWenan.put("content", format + FANAN_COMMON + messageWithShortUrl);
wenanArray.add(commonWenan);