From 7d94c9fcb47ff83c45e4fcdade80ef6c76dae075 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Mon, 8 Jul 2019 08:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=A0=A1=E9=AA=8C=E6=89=8B?= =?UTF-8?q?=E6=9C=BA&=E9=82=AE=E7=AE=B1=E4=B8=8D=E8=83=BD=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysUserController.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 5b53dd1c0..bceca0287 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 @@ -123,10 +123,18 @@ public class SysUserController extends BaseController { return error("不允许修改超级管理员用户"); } - if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName()))) + else if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName()))) { return error("保存用户'" + user.getLoginName() + "'失败,登录账号已存在"); } + else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + { + return error("保存用户'" + user.getLoginName() + "'失败,手机号码已存在"); + } + else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + { + return error("保存用户'" + user.getLoginName() + "'失败,邮箱账号已存在"); + } user.setSalt(ShiroUtils.randomSalt()); user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); user.setCreateBy(ShiroUtils.getLoginName()); @@ -158,6 +166,14 @@ public class SysUserController extends BaseController { return error("不允许修改超级管理员用户"); } + else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user))) + { + return error("保存用户'" + user.getLoginName() + "'失败,手机号码已存在"); + } + else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user))) + { + return error("保存用户'" + user.getLoginName() + "'失败,邮箱账号已存在"); + } user.setUpdateBy(ShiroUtils.getLoginName()); return toAjax(userService.updateUser(user)); }