|
@@ -6,6 +6,7 @@ import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.ObjUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.hutool.core.util.URLUtil;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.filestorage.FileStorageTemplate;
|
|
@@ -160,9 +161,12 @@ public class WorkOfflineListener implements ChannelAwareMessageListener {
|
|
|
}
|
|
|
if (ObjUtil.isNotEmpty(fodderEntity)&&StrUtil.isNotEmpty(fodderEntity.getIcon())&&!fodderEntity.getType().equalsIgnoreCase("pano")){
|
|
|
log.info("下载热点资源Icon:{}", fodderEntity.getIcon());
|
|
|
- String ossKeyHot = fodderEntity.getIcon().replaceAll(fileStorageTemplate.calculateUrl(""), "");
|
|
|
- String defaultDataPath =basePath+File.separator+ossKeyHot;
|
|
|
- fileStorageTemplate.ossDownloadFileToLocal(ossKeyHot, defaultDataPath);
|
|
|
+ //判断是不是url
|
|
|
+ if (fodderEntity.getIcon().startsWith("http")){
|
|
|
+ String ossKeyHot = fodderEntity.getIcon().replaceAll(fileStorageTemplate.calculateUrl(""), "");
|
|
|
+ String defaultDataPath =basePath+File.separator+ossKeyHot;
|
|
|
+ fileStorageTemplate.ossDownloadFileToLocal(ossKeyHot, defaultDataPath);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|