图库图片路径问题修复
This commit is contained in:
parent
fb10c6e173
commit
4e2a75520c
@ -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分钱分配:");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user