fuxingfan 4 vuotta sitten
vanhempi
commit
745e8e5963

+ 2
- 5
src/main/java/com/yunzhi/marketing/controller/CommonController.java Näytä tiedosto

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

+ 1
- 2
src/main/resources/application-dev.yml Näytä tiedosto

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