|
@@ -319,30 +319,25 @@ public class TechnologyArchivesService {
|
|
|
|
|
|
String uploadDir;
|
|
|
if (isProd) {
|
|
|
- uploadDir = "/home/certificateImage";
|
|
|
+ uploadDir = "/mnt/uploadiamge/certificateImage";
|
|
|
} else {
|
|
|
- uploadDir = "E:\\certificateImage";
|
|
|
+ //Z为网络映射盘(172.16.32.197\ uploadimage)
|
|
|
+ uploadDir = "Z:\\certificateImage";
|
|
|
}
|
|
|
JSONObject js = new JSONObject();
|
|
|
|
|
|
String name = file.getOriginalFilename();
|
|
|
- String fileName = null;
|
|
|
- if (name != null) {
|
|
|
- String newName = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
- fileName = newName.substring(0,5)+name.substring(name.lastIndexOf("."));
|
|
|
- }
|
|
|
+ String newName = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
+ String fileName = newName.substring(0,5)+name.substring(name.lastIndexOf("."));
|
|
|
Path uploadPath = Paths.get(uploadDir);
|
|
|
|
|
|
try {
|
|
|
Files.createDirectories(uploadPath);
|
|
|
- Path filePath = null;
|
|
|
- if (fileName != null) {
|
|
|
- filePath = uploadPath.resolve(fileName);
|
|
|
- }
|
|
|
+ Path filePath = uploadPath.resolve(fileName);
|
|
|
//
|
|
|
Files.copy(file.getInputStream(), filePath, StandardCopyOption.REPLACE_EXISTING);
|
|
|
log.info("文件:{}", fileName);
|
|
|
- url1 = "http://172.16.30.8:8077/certificateImage/" + fileName;
|
|
|
+ url1 = "http://172.16.32.197:8077/certificateImage/" + fileName;
|
|
|
// firstDao.updateCertificateImage(url, socialNo, getTime);
|
|
|
js.put("url", url1);
|
|
|
js.put("name", fileName);
|
|
@@ -449,9 +444,9 @@ public class TechnologyArchivesService {
|
|
|
|
|
|
String uploadDir;
|
|
|
if (isProd) {
|
|
|
- uploadDir = "/home/proImage";
|
|
|
+ uploadDir = "/mnt/uploadimage/proImage";
|
|
|
} else {
|
|
|
- uploadDir = "E:\\proImage";
|
|
|
+ uploadDir = "Z:\\proImage";
|
|
|
}
|
|
|
JSONObject js = new JSONObject();
|
|
|
|
|
@@ -472,7 +467,7 @@ public class TechnologyArchivesService {
|
|
|
//
|
|
|
Files.copy(file.getInputStream(), filePath, StandardCopyOption.REPLACE_EXISTING);
|
|
|
log.info("文件:{}", fileName);
|
|
|
- url2 = "http://172.16.30.8:8077/proImage/" + fileName;
|
|
|
+ url2 = "http://172.16.32.197:8077/proImage/" + fileName;
|
|
|
// firstDao.updateCertificateImage(url, socialNo, getTime);
|
|
|
js.put("url", url2);
|
|
|
js.put("name", fileName);
|