Commit 849b8b53 authored by wzp's avatar wzp

修改bug

parent a4f94d37
......@@ -173,7 +173,7 @@ public class TUserController extends BaseController {
try {
TUser tUser = userService.selectById(id);
List<Role> list = roleService.selectRoleByUserId(id);
if (list != null && list.size()>0&&list.get(0)!=null) {
if (list != null && list.size() > 0 && list.get(0) != null) {
List<String> list1 = new ArrayList<>();
list.forEach(r -> list1.add(r.getId()));
tUser.setRoleList(list1);
......@@ -325,7 +325,7 @@ public class TUserController extends BaseController {
ew.eq("type", "3");
ew.eq("org_id", user.getOrgId());
List<TUser> list = this.userService.list(ew);
if (list != null && list.size()>0&&list.get(0)!=null) {
if (list != null && list.size() > 0 && list.get(0) != null) {
resultMap.put("resultCode", "400");
resultMap.put("message", "每个单位只能有一个机顶盒账号!");
return resultMap;
......@@ -353,7 +353,7 @@ public class TUserController extends BaseController {
List<String> list = user.getRoleList();
if (null != list && list.size()>0&&list.get(0)!=null) {
if (null != list && list.size() > 0 && list.get(0) != null) {
//查询当前用户拥有的角色
QueryWrapper<TUserRole> userRoleWrapper = new QueryWrapper<>();
userRoleWrapper.eq("user_id", user.getId());
......@@ -565,9 +565,9 @@ public class TUserController extends BaseController {
return resultMap;
}
//密码解密
oldPassWord= AESUtils.aesDecrypt(oldPassWord);
oldPassWord = AESUtils.aesDecrypt(oldPassWord);
//密码解密
password=AESUtils.aesDecrypt(password);
password = AESUtils.aesDecrypt(password);
if (new String(SHA256PasswordEncryptionService.createPasswordHash(oldPassWord, salt))
.equals(new String(user.getPasswordHash()))) {
......@@ -609,9 +609,9 @@ public class TUserController extends BaseController {
public Map<String, Object> resetPassword(String userId) {
try {
Map<String, Object> map = new LinkedHashMap<>();
String newPassword = "gb123456";
TUser user = new TUser();
user.setId(userId);
String newPassword = "gb123456";
byte[] passwordSalt = SecureRandomSaltService.generateSalt();
byte[] passwordHash = SHA256PasswordEncryptionService.createPasswordHash(newPassword, passwordSalt);
user.setPasswordSalt(passwordSalt);
......@@ -625,7 +625,7 @@ public class TUserController extends BaseController {
stringRedisTemplate.delete(SHIRO_IS_LOCK + userService.getById(userId).getUserName());
map.put("resultCode", "200");
map.put("message", "重置密码成功");
map.put("data", newPassword);
map.put("data", "");
return map;
} catch (Exception e) {
logger.error("重置密码出错!", e);
......@@ -672,7 +672,7 @@ public class TUserController extends BaseController {
ew.eq("type", "3");
ew.eq("org_id", user.getOrgId());
List<TUser> list = this.userService.list(ew);
if (list != null && list.size()>0&&list.get(0)!=null) {
if (list != null && list.size() > 0 && list.get(0) != null) {
resultMap.put("resultCode", "400");
resultMap.put("message", "该单位机顶盒账号已存在!");
return resultMap;
......
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