From f0ffb844dca9fd66709c9ed9b564026893cd2a63 Mon Sep 17 00:00:00 2001 From: wcy <761646706@qq.com> Date: Tue, 8 Oct 2024 09:43:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=B4=E5=83=8F=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0sql=E6=8A=A5=E9=94=99=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/sgzb/system/controller/SysProfileController.java | 4 ++++ 1 file changed, 4 insertions(+) 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("上传图片异常,请联系管理员"); } }