Forráskód Böngészése

sz 附件上传修改

xiao547607 5 éve
szülő
commit
1f895ef7b7

+ 3 - 3
web/src/main/java/com/jpsoft/smart/modules/base/controller/PersonInfoController.java

@@ -764,14 +764,14 @@ public class PersonInfoController {
     @PostMapping("upload")
     @ApiOperation(value="人员照片上传")
     @ApiImplicitParams({
-            @ApiImplicitParam(name="photoName",value = "照片名称",required = true,paramType = "form"),
+            @ApiImplicitParam(name="subFolder",value = "路径",required = true,paramType = "form"),
             @ApiImplicitParam(name = "photoFile",value = "员工照片", required = true,paramType="form", dataType = "__file")
     })
-    public MessageResult<String> upload(String photoName, MultipartFile photoFile){
+    public MessageResult<String> upload(String subFolder, MultipartFile photoFile){
         MessageResult<String> messageResult = new MessageResult<>();
 
         try {
-            String retFileUrl = OSSUtil.upload(ossConfig,"/person",photoName,photoFile.getInputStream());
+            String retFileUrl = OSSUtil.upload(ossConfig,"/" + subFolder,photoFile.getOriginalFilename(),photoFile.getInputStream());
 
             messageResult.setResult(true);
             messageResult.setData(retFileUrl);