| | |
| | | */ |
| | | @RequestMapping(method = RequestMethod.POST, path = "/uploadImg") |
| | | @ResponseBody |
| | | public ResultUtil uploadImg(@RequestPart("file") MultipartFile picture, HttpServletResponse response) { |
| | | String value = ""; |
| | | public String uploadImg(@RequestPart("file") MultipartFile picture) { |
| | | String pictureName = ""; |
| | | try { |
| | | value = OssUploadUtil.ossUpload("img/", picture); |
| | | pictureName = OssUploadUtil.ossUpload("img/", picture); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | System.out.println("图片返回地址-------"+value); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("value",value); |
| | | // return ResultUtil.success(0,map); |
| | | return ResultUtil.getResult(0,null,null,map); |
| | | return pictureName; |
| | | } |
| | | |
| | | |