图库图片路径问题修复

This commit is contained in:
liyj 2025-11-27 10:13:28 +08:00
parent fb10c6e173
commit 4e2a75520c

View File

@ -509,7 +509,19 @@ public class CommonUtil {
} }
return tpl_label; return tpl_label;
} }
/**
* 为URL添加域名前缀如果URL不是以http/https开头
*
* @param imageDomain 图片域名
* @param url 图片URL
* @return 添加域名前缀后的URL
*/
public static String addDomainPrefix(String imageDomain, String url) {
if (url == null || url.startsWith("http://") || url.startsWith("https://")) {
return url;
}
return imageDomain + (url.startsWith("/") ? url : "/" + url);
}
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("测试1分钱分配:"); System.out.println("测试1分钱分配:");