|
|
@ -112,14 +112,18 @@ public class UserController { |
|
|
|
@ResponseBody |
|
|
|
@ResponseBody |
|
|
|
@RequestMapping("/update") |
|
|
|
@RequestMapping("/update") |
|
|
|
public Object update(SysUserVo vo,@RequestParam(value = "file",required = false) MultipartFile file) throws IOException { |
|
|
|
public Object update(SysUserVo vo,@RequestParam(value = "file",required = false) MultipartFile file) throws IOException { |
|
|
|
System.out.println(minUtil); |
|
|
|
|
|
|
|
minUtil.uploadFile(file.getInputStream()); |
|
|
|
|
|
|
|
Date nowTime = new Date(); |
|
|
|
Date nowTime = new Date(); |
|
|
|
AjaxResult ajaxResult = new AjaxResult(); |
|
|
|
AjaxResult ajaxResult = new AjaxResult(); |
|
|
|
if (vo!=null&&vo.getId()!=null){ |
|
|
|
if (vo!=null&&vo.getId()!=null){ |
|
|
|
SysUser sysUser = sysUserService.findOne(vo.getId()); |
|
|
|
SysUser sysUser = sysUserService.findOne(vo.getId()); |
|
|
|
BeanUtil.copyNotNull(sysUser,vo); |
|
|
|
BeanUtil.copyNotNull(sysUser,vo); |
|
|
|
sysUser.setUpdateTime(nowTime); |
|
|
|
sysUser.setUpdateTime(nowTime); |
|
|
|
|
|
|
|
UUID uuid = UUID.randomUUID(); |
|
|
|
|
|
|
|
String fileType = FileUtil.fileFormat(file.getOriginalFilename()); |
|
|
|
|
|
|
|
String newFileName = "wechat/"+uuid.toString()+"."+fileType; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
minUtil.uploadFile(newFileName,file.getInputStream()); |
|
|
|
String uploadFileName =upLoadFile(file); |
|
|
|
String uploadFileName =upLoadFile(file); |
|
|
|
sysUser.setImgUrl(uploadFileName); |
|
|
|
sysUser.setImgUrl(uploadFileName); |
|
|
|
sysUserService.update(sysUser); |
|
|
|
sysUserService.update(sysUser); |
|
|
|