|
@@ -314,10 +314,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUser> impleme
|
|
|
|
|
|
SysUser entity = new SysUser();
|
|
|
entity.setId(sysUserDTO.getUser_id());
|
|
|
- // MD5加密
|
|
|
- String md5Password = MD5Util.encrypt(sysUserDTO.getPassword());
|
|
|
- // 加盐加密
|
|
|
- String encodedPassword = encoder.encode(md5Password);
|
|
|
+
|
|
|
+// // MD5加密
|
|
|
+// String md5Password = MD5Util.encrypt(sysUserDTO.getPassword());
|
|
|
+
|
|
|
+ // 加盐加密 (前端会传已加密过的密码)
|
|
|
+ String encodedPassword = encoder.encode(sysUserDTO.getPassword());
|
|
|
entity.setPassword(encodedPassword);
|
|
|
//
|
|
|
System.out.println(entity);
|
|
@@ -327,8 +329,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUser> impleme
|
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
- } catch (NoSuchAlgorithmException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
} finally { lock.unlock(); }
|
|
|
}
|
|
|
|
|
@@ -362,9 +362,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUser> impleme
|
|
|
response.put("plain_password", password);
|
|
|
return response;
|
|
|
|
|
|
- } catch (InterruptedException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- } catch (NoSuchAlgorithmException e) {
|
|
|
+ } catch (InterruptedException | NoSuchAlgorithmException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
} finally { lock.unlock(); }
|
|
|
}
|
|
@@ -428,4 +426,26 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUser> impleme
|
|
|
} catch (InterruptedException e) { throw new RuntimeException(e);
|
|
|
} finally { lock.unlock(); }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核用户
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Map<String, Object> auditUser(SysUserDTO sysUserDTO) {
|
|
|
+ RLock lock = redissonClient.getLock("auditUser");
|
|
|
+ try { lock.tryLock(3, TimeUnit.SECONDS);
|
|
|
+
|
|
|
+ Long user_id = sysUserDTO.getUser_id();
|
|
|
+
|
|
|
+ SysUserInfo entity = new SysUserInfo();
|
|
|
+ entity.setAudit_status(sysUserDTO.getAudit_status());
|
|
|
+ entity.setAudit_note(sysUserDTO.getAudit_note());
|
|
|
+ sysUserInfoDao.update(entity, new LambdaQueryWrapper<SysUserInfo>().eq(SysUserInfo::getUser_id, user_id));
|
|
|
+
|
|
|
+ return Map.of("user_id", user_id);
|
|
|
+
|
|
|
+ } catch (InterruptedException e) { throw new RuntimeException(e);
|
|
|
+ } finally { lock.unlock(); }
|
|
|
+ }
|
|
|
}
|