fuxingfan 4 年之前
父節點
當前提交
745e8e5963

+ 2
- 5
src/main/java/com/yunzhi/marketing/controller/CommonController.java 查看文件

45
     @Value("${file.path}")
45
     @Value("${file.path}")
46
     private String FILE_PATH;
46
     private String FILE_PATH;
47
 
47
 
48
-    @Value("${file.domain}")
49
-    private String FILE_DOMAIN;
50
-
51
     SimpleDateFormat sdf = new SimpleDateFormat("yyyMMdd/");
48
     SimpleDateFormat sdf = new SimpleDateFormat("yyyMMdd/");
52
 
49
 
53
     /**
50
     /**
72
 
69
 
73
             // 文件保存操作
70
             // 文件保存操作
74
             multipartFile.transferTo(new File(folder, newName));
71
             multipartFile.transferTo(new File(folder, newName));
75
-            return ResponseBean.success(FILE_DOMAIN+"/file/"+ format + newName);
72
+            return ResponseBean.success("/file/"+ format + newName);
76
         } catch (IOException e) {
73
         } catch (IOException e) {
77
             return ResponseBean.error("上传图片失败: " + e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
74
             return ResponseBean.error("上传图片失败: " + e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
78
         }
75
         }
168
 
165
 
169
             // 文件保存操作
166
             // 文件保存操作
170
             multipartFile.transferTo(new File(folder, newName));
167
             multipartFile.transferTo(new File(folder, newName));
171
-            String img = FILE_DOMAIN+"/file/"+ format + newName;
168
+            String img = "/file/"+ format + newName;
172
             result.put("name", StringUtils.ifNull(multipartFile.getOriginalFilename(), multipartFile.getName()));
169
             result.put("name", StringUtils.ifNull(multipartFile.getOriginalFilename(), multipartFile.getName()));
173
             result.put("status", "done");
170
             result.put("status", "done");
174
             result.put("thumbUrl", img + "?x-oss-process=style/thumbnail");
171
             result.put("thumbUrl", img + "?x-oss-process=style/thumbnail");

+ 1
- 2
src/main/resources/application-dev.yml 查看文件

92
   redirectUrl: "https://dev.fangdeal.cn/other/redirect.html"
92
   redirectUrl: "https://dev.fangdeal.cn/other/redirect.html"
93
 # file path
93
 # file path
94
 file:
94
 file:
95
-  path: D:\images\
96
-  domain: http://localhost:8080
95
+  path: D:\images\