|
@@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -41,6 +42,8 @@ public class CommonController {
|
|
|
private ServerConfig serverConfig;
|
|
private ServerConfig serverConfig;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysUploadFileService iSysUploadFileService;
|
|
private ISysUploadFileService iSysUploadFileService;
|
|
|
|
|
+ @Value("${ktg-mes.prod}")
|
|
|
|
|
+ private String prodApi;
|
|
|
|
|
|
|
|
private static final String FILE_DELIMETER = ",";
|
|
private static final String FILE_DELIMETER = ",";
|
|
|
|
|
|
|
@@ -82,7 +85,13 @@ public class CommonController {
|
|
|
String filePath = RuoYiConfig.getUploadPath();
|
|
String filePath = RuoYiConfig.getUploadPath();
|
|
|
// 上传并返回新文件名称
|
|
// 上传并返回新文件名称
|
|
|
String fileName = FileUploadUtils.upload(filePath, file);
|
|
String fileName = FileUploadUtils.upload(filePath, file);
|
|
|
- String url = serverConfig.getUrl() + fileName;
|
|
|
|
|
|
|
+ String url;
|
|
|
|
|
+ if (StringUtils.isNotBlank(prodApi)) {
|
|
|
|
|
+ url = serverConfig.getUrl() + prodApi + fileName;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ url = serverConfig.getUrl() + fileName;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
AjaxResult ajax = AjaxResult.success();
|
|
AjaxResult ajax = AjaxResult.success();
|
|
|
ajax.put("url", url);
|
|
ajax.put("url", url);
|
|
|
ajax.put("fileName", fileName);
|
|
ajax.put("fileName", fileName);
|