This commit is contained in:
dinggang 2022-07-14 11:38:30 +08:00
parent 74edb1ef0c
commit 311cadef3e
1 changed files with 7 additions and 1 deletions

View File

@ -21,8 +21,12 @@ public class DevelopmentGuideServiceImpl implements DevelopmentGuideService {
@Value("${resource.devModelFilePath}")
private String devModelFilePath;
@Value("${resource.root_url}")
private String root_url;
private static Logger logger = LoggerFactory.getLogger(FileUploadController.class);
@Value("${server.servlet.context-path}")
private String context_path;
private static final Logger logger = LoggerFactory.getLogger(FileUploadController.class);
@Override
@ -81,6 +85,8 @@ public class DevelopmentGuideServiceImpl implements DevelopmentGuideService {
// 文件保存
uploadFile.transferTo(new File(path, fileName));
logger.info("----------------------------------文件上传成功--------------------------------------");
String filePath = request.getScheme() + "://" + root_url
+ ":" + request.getServerPort() + context_path + "/devModelFile/" + type + fileName;
return folder.getPath();
} catch (IOException e) {
logger.info("----------------------------------文件上传失败--------------------------------------");