From 94846d281fe7d1c8cc074f0dd053413543cb4496 Mon Sep 17 00:00:00 2001 From: Yjoioooo <693337446@qq.com> Date: Mon, 27 Mar 2023 13:44:39 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BF=AE=E6=94=B9controller=E4=B8=AD?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9ER.fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/controller/system/SysOssController.java | 2 +- .../ruoyi/system/controller/system/SysTenantController.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssController.java index 0d844bb7..89fb8600 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysOssController.java @@ -72,7 +72,7 @@ public class SysOssController extends BaseController { @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) public R upload(@RequestPart("file") MultipartFile file) { if (ObjectUtil.isNull(file)) { - throw new ServiceException("上传文件不能为空"); + R.fail("上传文件不能为空"); } SysOssVo oss = ossService.upload(file); SysOssUploadVo uploadVo = new SysOssUploadVo(); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysTenantController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysTenantController.java index de40c9be..8f388840 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysTenantController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/system/SysTenantController.java @@ -89,7 +89,7 @@ public class SysTenantController extends BaseController { @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody SysTenantBo bo) { if (!tenantService.checkCompanyNameUnique(bo)) { - throw new ServiceException("新增租户'" + bo.getCompanyName() + "'失败,企业名称已存在"); + R.fail("新增租户'" + bo.getCompanyName() + "'失败,企业名称已存在"); } return toAjax(tenantService.insertByBo(bo)); } @@ -105,7 +105,7 @@ public class SysTenantController extends BaseController { public R edit(@Validated(EditGroup.class) @RequestBody SysTenantBo bo) { tenantService.checkTenantAllowed(bo.getTenantId()); if (!tenantService.checkCompanyNameUnique(bo)) { - throw new ServiceException("修改租户'" + bo.getCompanyName() + "'失败,公司名称已存在"); + R.fail("修改租户'" + bo.getCompanyName() + "'失败,公司名称已存在"); } return toAjax(tenantService.updateByBo(bo)); }