Commit 314e4c99 authored by nie'hong's avatar nie'hong

修改用户信息限制管理员数量

parent 4fa5c761
......@@ -30,6 +30,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -424,7 +425,7 @@ public class TUserController extends BaseController {
resultMap.put("message", "机构已存在一个互动审核员!");
return resultMap;
}
if (StringUtils.isNotBlank(user.getRoleId())) {
if (StringUtils.isNotBlank(user.getRoleId()) && !CollectionUtils.isEmpty(user.getRoleList())) {
user.getRoleList().remove(ROLE_HDSHY);
user.getRoleList().remove(ROLE_PTGLY);
user.getRoleList().add(user.getRoleId());
......@@ -436,7 +437,6 @@ public class TUserController extends BaseController {
user.setUpdateTime(DateUtil80.getDateTimeOfTimestamp(System.currentTimeMillis()));
ret = userService.updateById(user);
List<String> list = user.getRoleList();
if (null != list && list.size() > 0 && list.get(0) != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment