若依开源1.1.4发布
This commit is contained in:
@ -56,7 +56,11 @@ public class UserConstants
|
||||
/** 字典类型是否唯一的返回结果码 */
|
||||
public final static String DICT_TYPE_UNIQUE = "0";
|
||||
public final static String DICT_TYPE_NOT_UNIQUE = "1";
|
||||
|
||||
|
||||
/** 参数键名是否唯一的返回结果码 */
|
||||
public final static String CONFIG_KEY_UNIQUE = "0";
|
||||
public final static String CONFIG_KEY_NOT_UNIQUE = "1";
|
||||
|
||||
/**
|
||||
* 密码长度限制
|
||||
*/
|
||||
|
@ -1,10 +1,13 @@
|
||||
package com.ruoyi.common.utils.security;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.mgt.RealmSecurityManager;
|
||||
import org.apache.shiro.session.Session;
|
||||
import org.apache.shiro.subject.PrincipalCollection;
|
||||
import org.apache.shiro.subject.SimplePrincipalCollection;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
|
||||
import com.ruoyi.framework.shiro.realm.UserRealm;
|
||||
import com.ruoyi.project.system.user.domain.User;
|
||||
|
||||
/**
|
||||
@ -19,7 +22,7 @@ public class ShiroUtils
|
||||
{
|
||||
return SecurityUtils.getSubject();
|
||||
}
|
||||
|
||||
|
||||
public static Session getSession()
|
||||
{
|
||||
return SecurityUtils.getSubject().getSession();
|
||||
@ -45,6 +48,13 @@ public class ShiroUtils
|
||||
subject.runAs(newPrincipalCollection);
|
||||
}
|
||||
|
||||
public static void clearCachedAuthorizationInfo()
|
||||
{
|
||||
RealmSecurityManager rsm = (RealmSecurityManager) SecurityUtils.getSecurityManager();
|
||||
UserRealm realm = (UserRealm) rsm.getRealms().iterator().next();
|
||||
realm.clearCachedAuthorizationInfo();
|
||||
}
|
||||
|
||||
public static Long getUserId()
|
||||
{
|
||||
return getUser().getUserId().longValue();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ruoyi.framework.shiro.realm;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.AuthenticationInfo;
|
||||
import org.apache.shiro.authc.AuthenticationToken;
|
||||
@ -16,6 +17,7 @@ import org.apache.shiro.subject.PrincipalCollection;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.ruoyi.common.exception.user.CaptchaException;
|
||||
import com.ruoyi.common.exception.user.RoleBlockedException;
|
||||
import com.ruoyi.common.exception.user.UserBlockedException;
|
||||
@ -36,10 +38,10 @@ import com.ruoyi.project.system.user.domain.User;
|
||||
public class UserRealm extends AuthorizingRealm
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(UserRealm.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private IMenuService menuService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IRoleService roleService;
|
||||
|
||||
@ -113,4 +115,12 @@ public class UserRealm extends AuthorizingRealm
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理缓存权限
|
||||
*/
|
||||
public void clearCachedAuthorizationInfo()
|
||||
{
|
||||
this.clearCachedAuthorizationInfo(SecurityUtils.getSubject().getPrincipals());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.project.system.config.service.IConfigService;
|
||||
|
||||
/**
|
||||
* RuoYi首创 html调用 thymeleaf 实现参数管理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public class ConfigService
|
||||
{
|
||||
@Autowired
|
||||
private IConfigService configService;
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configName 参数名称
|
||||
* @return 参数键值
|
||||
*/
|
||||
public String selectConfigByKey(String configKey)
|
||||
{
|
||||
return configService.selectConfigByKey(configKey);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
package com.ruoyi.project.system.config.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.project.system.config.domain.Config;
|
||||
import com.ruoyi.project.system.config.service.IConfigService;
|
||||
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.page.TableDataInfo;
|
||||
import com.ruoyi.framework.web.domain.Message;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/system/config")
|
||||
public class ConfigController extends BaseController
|
||||
{
|
||||
private String prefix = "system/config";
|
||||
|
||||
@Autowired
|
||||
private IConfigService configService;
|
||||
|
||||
@RequiresPermissions("system:config:view")
|
||||
@GetMapping()
|
||||
public String index()
|
||||
{
|
||||
return prefix + "/config";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*/
|
||||
@RequiresPermissions("system:config:list")
|
||||
@GetMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(Config config)
|
||||
{
|
||||
startPage();
|
||||
List<Config> list = configService.selectConfigList(config);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
@RequiresPermissions("system:config:add")
|
||||
@Log(title = "系统管理", action = "参数配置-新增参数")
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@RequiresPermissions("system:config:edit")
|
||||
@Log(title = "系统管理", action = "参数配置-修改参数")
|
||||
@GetMapping("/edit/{configId}")
|
||||
public String edit(@PathVariable("configId") Integer configId, Model model)
|
||||
{
|
||||
Config config = configService.selectConfigById(configId);
|
||||
model.addAttribute("config", config);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存参数配置
|
||||
*/
|
||||
@RequiresPermissions("system:config:save")
|
||||
@Log(title = "系统管理", action = "参数配置-保存参数")
|
||||
@PostMapping("/save")
|
||||
@ResponseBody
|
||||
public Message save(Config config)
|
||||
{
|
||||
if (configService.saveConfig(config) > 0)
|
||||
{
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
*/
|
||||
@RequiresPermissions("system:config:remove")
|
||||
@Log(title = "系统管理", action = "参数配置-删除参数")
|
||||
@PostMapping("/remove/{configId}")
|
||||
@ResponseBody
|
||||
public Message remove(@PathVariable("configId") Integer configId)
|
||||
{
|
||||
if (configService.deleteConfigById(configId) > 0)
|
||||
{
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除参数配置
|
||||
*/
|
||||
@RequiresPermissions("system:config:batchRemove")
|
||||
@Log(title = "系统管理", action = "参数配置-批量删除")
|
||||
@PostMapping("/batchRemove")
|
||||
@ResponseBody
|
||||
public Message remove(@RequestParam("ids[]") Integer[] configIds)
|
||||
{
|
||||
int rows = configService.batchDeleteConfig(configIds);
|
||||
if (rows > 0)
|
||||
{
|
||||
return Message.success();
|
||||
}
|
||||
return Message.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数键名
|
||||
*/
|
||||
@PostMapping("/checkConfigKeyUnique")
|
||||
@ResponseBody
|
||||
public String checkConfigKeyUnique(Config config)
|
||||
{
|
||||
String uniqueFlag = "0";
|
||||
if (config != null)
|
||||
{
|
||||
uniqueFlag = configService.checkConfigKeyUnique(config);
|
||||
}
|
||||
return uniqueFlag;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package com.ruoyi.project.system.config.domain;
|
||||
|
||||
import com.ruoyi.framework.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 参数配置表 sys_config
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class Config extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 参数主键 */
|
||||
private Integer configId;
|
||||
/** 参数名称 */
|
||||
private String configName;
|
||||
/** 参数键名 */
|
||||
private String configKey;
|
||||
/** 参数键值 */
|
||||
private String configValue;
|
||||
/** 系统内置(Y是 N否) */
|
||||
private String configType;
|
||||
|
||||
public Integer getConfigId()
|
||||
{
|
||||
return configId;
|
||||
}
|
||||
|
||||
public void setConfigId(Integer configId)
|
||||
{
|
||||
this.configId = configId;
|
||||
}
|
||||
|
||||
public String getConfigName()
|
||||
{
|
||||
return configName;
|
||||
}
|
||||
|
||||
public void setConfigName(String configName)
|
||||
{
|
||||
this.configName = configName;
|
||||
}
|
||||
|
||||
public String getConfigKey()
|
||||
{
|
||||
return configKey;
|
||||
}
|
||||
|
||||
public void setConfigKey(String configKey)
|
||||
{
|
||||
this.configKey = configKey;
|
||||
}
|
||||
|
||||
public String getConfigValue()
|
||||
{
|
||||
return configValue;
|
||||
}
|
||||
|
||||
public void setConfigValue(String configValue)
|
||||
{
|
||||
this.configValue = configValue;
|
||||
}
|
||||
|
||||
public String getConfigType()
|
||||
{
|
||||
return configType;
|
||||
}
|
||||
|
||||
public void setConfigType(String configType)
|
||||
{
|
||||
this.configType = configType;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.ruoyi.project.system.config.mapper;
|
||||
|
||||
import com.ruoyi.project.system.config.domain.Config;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ConfigMapper
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
public Config selectConfigById(Integer configId);
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configName 参数名称
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
public Config selectConfigByKey(String configKey);
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<Config> selectConfigList(Config config);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertConfig(Config config);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateConfig(Config config);
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteConfigById(Integer configId);
|
||||
|
||||
/**
|
||||
* 批量删除参数配置
|
||||
*
|
||||
* @param configIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchDeleteConfig(Integer[] configIds);
|
||||
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
package com.ruoyi.project.system.config.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.project.system.config.domain.Config;
|
||||
import com.ruoyi.project.system.config.mapper.ConfigMapper;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceImpl implements IConfigService
|
||||
{
|
||||
@Autowired
|
||||
private ConfigMapper configMapper;
|
||||
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
@Override
|
||||
public Config selectConfigById(Integer configId)
|
||||
{
|
||||
return configMapper.selectConfigById(configId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configName 参数名称
|
||||
* @return 参数键值
|
||||
*/
|
||||
@Override
|
||||
public String selectConfigByKey(String configKey)
|
||||
{
|
||||
Config config = configMapper.selectConfigByKey(configKey);
|
||||
return StringUtils.isNotNull(config) ? config.getConfigValue() : "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
@Override
|
||||
public List<Config> selectConfigList(Config config)
|
||||
{
|
||||
return configMapper.selectConfigList(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertConfig(Config config)
|
||||
{
|
||||
return configMapper.insertConfig(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateConfig(Config config)
|
||||
{
|
||||
return configMapper.updateConfig(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int saveConfig(Config config)
|
||||
{
|
||||
Integer configId = config.getConfigId();
|
||||
int rows = 0;
|
||||
if (StringUtils.isNotNull(configId))
|
||||
{
|
||||
rows = configMapper.updateConfig(config);
|
||||
}
|
||||
else
|
||||
{
|
||||
rows = configMapper.insertConfig(config);
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置信息
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteConfigById(Integer configId)
|
||||
{
|
||||
return configMapper.deleteConfigById(configId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除参数配置对象
|
||||
*
|
||||
* @param configIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int batchDeleteConfig(Integer[] configIds)
|
||||
{
|
||||
return configMapper.batchDeleteConfig(configIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数键名是否唯一
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkConfigKeyUnique(Config config)
|
||||
{
|
||||
if (config.getConfigId() == null)
|
||||
{
|
||||
config.setConfigId(-1);
|
||||
}
|
||||
Integer configId = config.getConfigId();
|
||||
Config info = configMapper.selectConfigByKey(config.getConfigKey());
|
||||
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getConfigId())
|
||||
&& info.getConfigId().intValue() != configId.intValue())
|
||||
{
|
||||
return UserConstants.CONFIG_KEY_NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.CONFIG_KEY_UNIQUE;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package com.ruoyi.project.system.config.service;
|
||||
|
||||
import com.ruoyi.project.system.config.domain.Config;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface IConfigService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询参数配置信息
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 参数配置信息
|
||||
*/
|
||||
public Config selectConfigById(Integer configId);
|
||||
|
||||
/**
|
||||
* 根据键名查询参数配置信息
|
||||
*
|
||||
* @param configName 参数名称
|
||||
* @return 参数键值
|
||||
*/
|
||||
public String selectConfigByKey(String configKey);
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<Config> selectConfigList(Config config);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertConfig(Config config);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateConfig(Config config);
|
||||
|
||||
/**
|
||||
* 保存参数配置
|
||||
*
|
||||
* @param config 参数配置信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int saveConfig(Config config);
|
||||
|
||||
/**
|
||||
* 删除参数配置信息
|
||||
*
|
||||
* @param configId 参数配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteConfigById(Integer configId);
|
||||
|
||||
/**
|
||||
* 批量删除参数配置信息
|
||||
*
|
||||
* @param configIds 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchDeleteConfig(Integer[] configIds);
|
||||
|
||||
/**
|
||||
* 校验参数键名是否唯一
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkConfigKeyUnique(Config config);
|
||||
|
||||
}
|
@ -140,6 +140,10 @@ public class DeptServiceImpl implements IDeptService
|
||||
@Override
|
||||
public String checkDeptNameUnique(Dept dept)
|
||||
{
|
||||
if (dept.getDeptId() == null)
|
||||
{
|
||||
dept.setDeptId(-1L);
|
||||
}
|
||||
Long deptId = dept.getDeptId();
|
||||
Dept info = deptMapper.checkDeptNameUnique(dept.getDeptName());
|
||||
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getDeptId())
|
||||
|
@ -192,6 +192,7 @@ public class MenuServiceImpl implements IMenuService
|
||||
@Override
|
||||
public int deleteMenuById(Long menuId)
|
||||
{
|
||||
ShiroUtils.clearCachedAuthorizationInfo();
|
||||
return menuMapper.deleteMenuById(menuId);
|
||||
}
|
||||
|
||||
@ -244,11 +245,13 @@ public class MenuServiceImpl implements IMenuService
|
||||
if (StringUtils.isNotNull(menuId))
|
||||
{
|
||||
menu.setUpdateBy(ShiroUtils.getLoginName());
|
||||
ShiroUtils.clearCachedAuthorizationInfo();
|
||||
return menuMapper.updateMenu(menu);
|
||||
}
|
||||
else
|
||||
{
|
||||
menu.setCreateBy(ShiroUtils.getLoginName());
|
||||
ShiroUtils.clearCachedAuthorizationInfo();
|
||||
return menuMapper.insertMenu(menu);
|
||||
}
|
||||
}
|
||||
@ -262,6 +265,10 @@ public class MenuServiceImpl implements IMenuService
|
||||
@Override
|
||||
public String checkMenuNameUnique(Menu menu)
|
||||
{
|
||||
if (menu.getMenuId() == null)
|
||||
{
|
||||
menu.setMenuId(-1L);
|
||||
}
|
||||
Long menuId = menu.getMenuId();
|
||||
Menu info = menuMapper.checkMenuNameUnique(menu.getMenuName());
|
||||
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getMenuId())
|
||||
|
@ -165,6 +165,7 @@ public class RoleServiceImpl implements IRoleService
|
||||
// 新增角色信息
|
||||
roleMapper.insertRole(role);
|
||||
}
|
||||
ShiroUtils.clearCachedAuthorizationInfo();
|
||||
return insertRoleMenu(role);
|
||||
}
|
||||
|
||||
@ -201,6 +202,10 @@ public class RoleServiceImpl implements IRoleService
|
||||
@Override
|
||||
public String checkRoleNameUnique(Role role)
|
||||
{
|
||||
if (role.getRoleId() == null)
|
||||
{
|
||||
role.setRoleId(-1L);
|
||||
}
|
||||
Long roleId = role.getRoleId();
|
||||
Role info = roleMapper.checkRoleNameUnique(role.getRoleName());
|
||||
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getRoleId()) && info.getRoleId() != roleId)
|
||||
|
@ -274,6 +274,10 @@ public class UserServiceImpl implements IUserService
|
||||
@Override
|
||||
public String checkPhoneUnique(User user)
|
||||
{
|
||||
if (user.getUserId() == null)
|
||||
{
|
||||
user.setUserId(-1L);
|
||||
}
|
||||
Long userId = user.getUserId();
|
||||
User info = userMapper.checkPhoneUnique(user.getPhonenumber());
|
||||
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getUserId())
|
||||
@ -293,6 +297,10 @@ public class UserServiceImpl implements IUserService
|
||||
@Override
|
||||
public String checkEmailUnique(User user)
|
||||
{
|
||||
if (user.getUserId() == null)
|
||||
{
|
||||
user.setUserId(-1L);
|
||||
}
|
||||
Long userId = user.getUserId();
|
||||
User info = userMapper.checkEmailUnique(user.getEmail());
|
||||
if (StringUtils.isNotNull(info) && StringUtils.isNotNull(info.getUserId())
|
||||
|
Reference in New Issue
Block a user