Commit c3abce67 authored by renjie's avatar renjie

删除IpBug

parent 2a265d3d
...@@ -362,6 +362,7 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -362,6 +362,7 @@ public class IpResourceServiceImpl implements IpResourceService {
} }
UserShop userShop = null; UserShop userShop = null;
if (ipResource.getShopId() != null) {
Shop shop = shopRepository.findById(ipResource.getShopId()).orElse(null); Shop shop = shopRepository.findById(ipResource.getShopId()).orElse(null);
if (shop != null) { if (shop != null) {
userShop = userShopRepository.findByUsernameAndShopId(username, shop.getShopId()); userShop = userShopRepository.findByUsernameAndShopId(username, shop.getShopId());
...@@ -373,6 +374,7 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -373,6 +374,7 @@ public class IpResourceServiceImpl implements IpResourceService {
ipOperationResultDto.getFailList().add(ipAddr); ipOperationResultDto.getFailList().add(ipAddr);
return; return;
} }
}
try { try {
ResponseEntity<String> result = restTemplate.exchange(URL + "/intelligroup/ipresources?accountId=browser&ip={ip}", HttpMethod.DELETE, httpEntity, String.class, ipAddr); ResponseEntity<String> result = restTemplate.exchange(URL + "/intelligroup/ipresources?accountId=browser&ip={ip}", HttpMethod.DELETE, httpEntity, String.class, ipAddr);
DeleteIpResultDto deleteIpResultDto = JSON.parseObject(result.getBody(), DeleteIpResultDto.class); DeleteIpResultDto deleteIpResultDto = JSON.parseObject(result.getBody(), DeleteIpResultDto.class);
...@@ -407,6 +409,7 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -407,6 +409,7 @@ public class IpResourceServiceImpl implements IpResourceService {
DeleteIpResultDto deleteIpResultDto = JSON.parseObject(result.getBody(), DeleteIpResultDto.class); DeleteIpResultDto deleteIpResultDto = JSON.parseObject(result.getBody(), DeleteIpResultDto.class);
} }
UserShop userShop = null; UserShop userShop = null;
if (ipResource.getShopId() != null) {
Shop shop = shopRepository.findById(ipResource.getShopId()).orElse(null); Shop shop = shopRepository.findById(ipResource.getShopId()).orElse(null);
if (shop != null) { if (shop != null) {
userShop = userShopRepository.findByUsernameAndShopId(username, shop.getShopId()); userShop = userShopRepository.findByUsernameAndShopId(username, shop.getShopId());
...@@ -418,6 +421,7 @@ public class IpResourceServiceImpl implements IpResourceService { ...@@ -418,6 +421,7 @@ public class IpResourceServiceImpl implements IpResourceService {
ipOperationResultDto.getFailList().add(ipId); ipOperationResultDto.getFailList().add(ipId);
return; return;
} }
}
ipResource.setDeleted(true); ipResource.setDeleted(true);
ipResource.setShopId(null); ipResource.setShopId(null);
ipResource.setShopName(null); ipResource.setShopName(null);
......
package com.edgec.browserbackend.common.utils; package com.edgec.browserbackend.common.utils;
import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import sun.misc.BASE64Decoder; import sun.misc.BASE64Decoder;
...@@ -149,17 +150,16 @@ public class Aes { ...@@ -149,17 +150,16 @@ public class Aes {
return StringUtils.isEmpty(encryptStr) ? null : aesDecryptByBytes(base64Decode(encryptStr), decryptKey); return StringUtils.isEmpty(encryptStr) ? null : aesDecryptByBytes(base64Decode(encryptStr), decryptKey);
} }
private static final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
/** /**
* 测试 * 测试
*/ */
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String content = "VHRg3tocHf9i2Q27COKDhw=="; String content = "abc123456";
// System.out.println("加密前:" + content); System.out.println("加密前:" + content);
// System.out.println("加密密钥和解密密钥:" + KEY); System.out.println("加密密钥和解密密钥:" + KEY);
// String encrypt = aesEncrypt(content, KEY); String encrypt = encoder.encode(content);
// System.out.println("加密后:" + encrypt); System.out.println("加密后:" + encrypt);
String decrypt = aesDecrypt(content, KEY);
System.out.println("解密后:" + decrypt);
} }
} }
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