| | |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.ruoyi.common.constant.CacheConstants; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.Sm4Utils; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private ISysPostService postService; |
| | | |
| | | @Autowired |
| | | RedisCache redisCache; |
| | | /** |
| | | * 获取用户列表 |
| | | */ |
| | |
| | | { |
| | | return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| | | } |
| | | if (user.getIsDriver() == 0 && !userService.checkDriverUnique(user)){ |
| | | return error("新增用户'" + user.getUserName() + "'失败,驾驶员已绑定其他账户"); |
| | | |
| | | }else{ |
| | | user.setDriverId(null); |
| | | } |
| | | |
| | | user.setCreateBy(getUsername()); |
| | | user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); |
| | | return toAjax(userService.insertUser(user)); |
| | |
| | | { |
| | | return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); |
| | | } |
| | | if (user.getIsDriver() == 0 && !userService.checkDriverUnique(user)){ |
| | | return error("新增用户'" + user.getUserName() + "'失败,驾驶员已绑定其他账户"); |
| | | |
| | | } |
| | | |
| | | user.setUpdateBy(getUsername()); |
| | | return toAjax(userService.updateUser(user)); |
| | | } |
| | |
| | | return ajax; |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:user:edit')") |
| | | @GetMapping("/unLockUser/{userName}") |
| | | public AjaxResult unLockUser(@PathVariable("userName") String userName) |
| | | { |
| | | redisCache.deleteObject(CacheConstants.PWD_ERR_CNT_KEY + userName); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * 用户授权角色 |
| | | */ |