Commit 77135644 by 黄明步

.

parent 36eacfa3
...@@ -69,6 +69,12 @@ public class ServerInfoServiceImpl implements ServerInfoService { ...@@ -69,6 +69,12 @@ public class ServerInfoServiceImpl implements ServerInfoService {
try { try {
IPage<ServerInfo> result = this.serverInfoMapper.selectPage(page, queryWrapper); IPage<ServerInfo> result = this.serverInfoMapper.selectPage(page, queryWrapper);
// 对147.2.开头的ip进行特殊处理,设置是否接入取反
result.getRecords().forEach(serverInfo -> {
if (serverInfo.getIp().startsWith("147.2.")) {
serverInfo.setAccessService(!serverInfo.getAccessService());
}
});
if (!ListUtils.isEmpty(result.getRecords())) { if (!ListUtils.isEmpty(result.getRecords())) {
return new Result(true, Result.SUCCESS, "查询分页成功", result.getTotal(), result.getRecords()); return new Result(true, Result.SUCCESS, "查询分页成功", result.getTotal(), result.getRecords());
} }
...@@ -199,6 +205,10 @@ public class ServerInfoServiceImpl implements ServerInfoService { ...@@ -199,6 +205,10 @@ public class ServerInfoServiceImpl implements ServerInfoService {
@Override @Override
public Result updateServer(ServerInfo serverInfo) { public Result updateServer(ServerInfo serverInfo) {
try { try {
serverInfo = serverInfoMapper.selectByPrimaryKey(serverInfo.getServerId());
if (serverInfo.getIp().startsWith("147.2.")) {
serverInfo.setAccessService(!serverInfo.getAccessService());
}
if (StringUtils.isNotEmpty(serverInfo.getPassword())) { if (StringUtils.isNotEmpty(serverInfo.getPassword())) {
//对密码进行加密 //对密码进行加密
serverInfo.setPassword(AES.encrypt(serverInfo.getPassword(), aesKey)); serverInfo.setPassword(AES.encrypt(serverInfo.getPassword(), aesKey));
......
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