修改头像增加sql报错处理
This commit is contained in:
parent
d63830f40f
commit
f0ffb844dc
|
|
@ -120,6 +120,7 @@ public class SysProfileController extends BaseController {
|
||||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/avatar")
|
@PostMapping("/avatar")
|
||||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file,String fileType) throws Exception {
|
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file,String fileType) throws Exception {
|
||||||
|
try {
|
||||||
FileInfo fileInfo = sysFileService.uploadHeadPic(file, fileType);
|
FileInfo fileInfo = sysFileService.uploadHeadPic(file, fileType);
|
||||||
if (!file.isEmpty()) {
|
if (!file.isEmpty()) {
|
||||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||||
|
|
@ -140,6 +141,9 @@ public class SysProfileController extends BaseController {
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("系统异常,请联系管理员!");
|
||||||
|
}
|
||||||
return error("上传图片异常,请联系管理员");
|
return error("上传图片异常,请联系管理员");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue