diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java index 8cbea8eb..2dcb8437 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java @@ -121,7 +121,7 @@ public class SysConfigController extends BaseController { @DeleteMapping("/{configIds}") public R remove(@ApiParam("参数ID串") @PathVariable Long[] configIds) { configService.deleteConfigByIds(configIds); - return success(); + return R.ok(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java index cf23f861..060e980e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java @@ -108,6 +108,6 @@ public class SysDictDataController extends BaseController { @DeleteMapping("/{dictCodes}") public R remove(@ApiParam("字典code串") @PathVariable Long[] dictCodes) { dictDataService.deleteDictDataByIds(dictCodes); - return success(); + return R.ok(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java index 54e31e47..c8ebd49b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java @@ -98,7 +98,7 @@ public class SysDictTypeController extends BaseController { @DeleteMapping("/{dictIds}") public R remove(@ApiParam("字典ID串") @PathVariable Long[] dictIds) { dictTypeService.deleteDictTypeByIds(dictIds); - return success(); + return R.ok(); } /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java index c1c79503..6595f06d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java @@ -31,9 +31,9 @@ public class SysRegisterController extends BaseController { @PostMapping("/register") public R register(@Validated @RequestBody RegisterBody user) { if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) { - return error("当前系统没有开启注册功能!"); + return R.fail("当前系统没有开启注册功能!"); } registerService.register(user); - return success(); + return R.ok(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 18ba4a3b..0c2e9e02 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -170,7 +170,7 @@ public class SysUserController extends BaseController { @DeleteMapping("/{userIds}") public R remove(@ApiParam("角色ID串") @PathVariable Long[] userIds) { if (ArrayUtil.contains(userIds, getUserId())) { - return error("当前用户不能删除"); + return R.fail("当前用户不能删除"); } return toAjax(userService.deleteUserByIds(userIds)); } @@ -231,6 +231,6 @@ public class SysUserController extends BaseController { public R insertAuthRole(Long userId, Long[] roleIds) { userService.checkUserDataScope(userId); userService.insertUserAuth(userId, roleIds); - return success(); + return R.ok(); } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java index 611cb156..1e0a5d52 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -8,38 +8,10 @@ import com.ruoyi.common.utils.StringUtils; /** * web层通用数据处理 * - * @author ruoyi + * @author Lion Li */ public class BaseController { - /** - * 返回成功 - */ - public R success() { - return R.ok(); - } - - /** - * 返回失败消息 - */ - public R error() { - return R.fail(); - } - - /** - * 返回成功消息 - */ - public R success(String message) { - return R.ok(message); - } - - /** - * 返回失败消息 - */ - public R error(String message) { - return R.fail(message); - } - /** * 响应返回结果 * @@ -57,7 +29,7 @@ public class BaseController { * @return 操作结果 */ protected R toAjax(boolean result) { - return result ? success() : error(); + return result ? R.ok() : R.fail(); } /**