diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SysProfileController.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SysProfileController.java index fc25adc..5fd22d5 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SysProfileController.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/SysProfileController.java @@ -120,6 +120,7 @@ public class SysProfileController extends BaseController { @Log(title = "用户头像", businessType = BusinessType.UPDATE) @PostMapping("/avatar") public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file,String fileType) throws Exception { + try { FileInfo fileInfo = sysFileService.uploadHeadPic(file, fileType); if (!file.isEmpty()) { LoginUser loginUser = SecurityUtils.getLoginUser(); @@ -140,6 +141,9 @@ public class SysProfileController extends BaseController { return ajax; } } + } catch (Exception e) { + throw new RuntimeException("系统异常,请联系管理员!"); + } return error("上传图片异常,请联系管理员"); } }