|
@@ -2,6 +2,7 @@ package org.eco.system.service.impl;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.eco.common.core.config.EcoConfig;
|
|
|
+import org.eco.common.core.constant.Constants;
|
|
|
import org.eco.common.core.exception.BusinessException;
|
|
|
import org.eco.common.core.utils.StringUtils;
|
|
|
import org.eco.common.core.utils.file.FileUploadUtils;
|
|
@@ -38,7 +39,7 @@ public class CommonService implements ICommonService {
|
|
|
String filePath = EcoConfig.getUploadPath();
|
|
|
// 上传并返回新文件名称
|
|
|
String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
- String url = serverConfig.getUrl() + fileName;
|
|
|
+ String url = Constants.HTTP + getIpAddress() + ":" + port + fileName;
|
|
|
String originalFilename = file.getOriginalFilename();
|
|
|
assert originalFilename != null;
|
|
|
String suffix = StringUtils.substring(originalFilename, originalFilename.lastIndexOf("."), originalFilename.length());
|