mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
🐛 修复非个人版的 OneDrive CF 加速域名无法正常使用的 BUG
This commit is contained in:
@@ -5,6 +5,9 @@ import cn.hutool.core.util.URLUtil;
|
||||
import im.zhaojun.zfile.model.constant.ZFileConstant;
|
||||
import im.zhaojun.zfile.service.SystemConfigService;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* @author zhaojun
|
||||
*/
|
||||
@@ -115,7 +118,13 @@ public class StringUtils {
|
||||
* @return 替换后的 URL
|
||||
*/
|
||||
public static String replaceHost(String originUrl, String replaceHost) {
|
||||
return concatPath(replaceHost, URLUtil.getPath(originUrl));
|
||||
try {
|
||||
String path = new URL(originUrl).getFile();
|
||||
return concatPath(replaceHost, path);
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user