Commit 06880979 authored by xuxin's avatar xuxin

保存用户明文密码

parent f35f9330
...@@ -107,13 +107,14 @@ public class UserServiceImpl implements UserService { ...@@ -107,13 +107,14 @@ public class UserServiceImpl implements UserService {
} }
); );
String hash = encoder.encode(user.getPassword()); String password = user.getPassword();
user.setPassword(hash);
String hash = encoder.encode(password);
user.setPassword(hash);
repository.save(user); repository.save(user);
// 保存明文密码 // 保存明文密码
userCodeRepository.save(new UserCode(user.getUsername(), user.getPassword())); userCodeRepository.save(new UserCode(user.getUsername(), password));
log.info("new user has been created: {}", user.getUsername()); log.info("new user has been created: {}", user.getUsername());
} }
......
...@@ -81,8 +81,10 @@ public class IpResourceRepositoryCustomImpl implements IpResourceRepositoryCusto ...@@ -81,8 +81,10 @@ public class IpResourceRepositoryCustomImpl implements IpResourceRepositoryCusto
@Override @Override
public List<IpResource> sampleTasks(List<Integer> status) { public List<IpResource> sampleTasks(List<Integer> status) {
Criteria matchCriteria = new Criteria(); Criteria matchCriteria = new Criteria();
matchCriteria.orOperator(where("status").in(status).and("isLocked").is(false).and("validTime").gt(Instant.now().toEpochMilli()).and("isDeleted").is(false).and("healthLockTimestamp").lte(Instant.now().minusSeconds(60 * 30).toEpochMilli()), matchCriteria.orOperator(
where("status").in(status).and("isLocked").is(true).and("healthLockTimestamp").lte(Instant.now().minusSeconds(600).toEpochMilli()).and("isDeleted").is(false)); where("status").in(status).and("isLocked").is(false).and("validTime").gt(Instant.now().toEpochMilli()).and("isDeleted").is(false).and("healthLockTimestamp").lte(Instant.now().minusSeconds(60 * 30).toEpochMilli()),
where("status").in(status).and("isLocked").is(true).and("healthLockTimestamp").lte(Instant.now().minusSeconds(600).toEpochMilli()).and("isDeleted").is(false)
);
MatchOperation match = Aggregation.match(matchCriteria); MatchOperation match = Aggregation.match(matchCriteria);
......
...@@ -92,7 +92,7 @@ public class Set3proxyTask { ...@@ -92,7 +92,7 @@ public class Set3proxyTask {
bw.write("\nallow none\nproxy -p20004\nsocks -p20005\n"); bw.write("\nallow none\nproxy -p20004\nsocks -p20005\n");
bw.flush(); bw.flush();
bw.close(); bw.close();
log.error("成功写入文件"); log.info("成功写入文件");
if (proxyConfigRepository.count() > 0) { if (proxyConfigRepository.count() > 0) {
ProxyConfig proxyConfig = proxyConfigRepository.findAll().get(0); ProxyConfig proxyConfig = proxyConfigRepository.findAll().get(0);
......
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