Commit d9b999bb authored by 技术部-任文超's avatar 技术部-任文超

驼峰命名

parent a95181e2
...@@ -1371,7 +1371,7 @@ public class InnerController implements IBaseController { ...@@ -1371,7 +1371,7 @@ public class InnerController implements IBaseController {
if (null != content) { if (null != content) {
content = content.replaceAll(" ", "+"); content = content.replaceAll(" ", "+");
} }
String str = AESUtil.decryptAfterBase64Decode(content, Constants.AES_KEY); String str = AesUtil.decryptAfterBase64Decode(content, Constants.AES_KEY);
if (null == str || !str.equals(phoneNo)) { if (null == str || !str.equals(phoneNo)) {
return JsonResult.buildErrorStateResult("解密有误", null); return JsonResult.buildErrorStateResult("解密有误", null);
} }
...@@ -1432,9 +1432,9 @@ public class InnerController implements IBaseController { ...@@ -1432,9 +1432,9 @@ public class InnerController implements IBaseController {
if (null != content) { if (null != content) {
content = content.replaceAll(" ", "+"); content = content.replaceAll(" ", "+");
} }
String str = AESUtil.decryptAfterBase64Decode(content, Constants.AES_KEY); String str = AesUtil.decryptAfterBase64Decode(content, Constants.AES_KEY);
if (null == str || !str.equals(phoneNo)) { if (null == str || !str.equals(phoneNo)) {
log.info("[forbiddenUserOrNot][禁用或激活用户]:解密有误, phoneNo:{},aes:{}", phoneNo, AESUtil.encryptAndBase64Encode(phoneNo, Constants.AES_KEY)); log.info("[forbiddenUserOrNot][禁用或激活用户]:解密有误, phoneNo:{},aes:{}", phoneNo, AesUtil.encryptAndBase64Encode(phoneNo, Constants.AES_KEY));
return JsonResult.buildErrorStateResult("解密有误", null); return JsonResult.buildErrorStateResult("解密有误", null);
} }
if (!ValidationUtil.validatePhoneNo(phoneNo)) { if (!ValidationUtil.validatePhoneNo(phoneNo)) {
...@@ -1472,7 +1472,7 @@ public class InnerController implements IBaseController { ...@@ -1472,7 +1472,7 @@ public class InnerController implements IBaseController {
if (null != content) { if (null != content) {
content = content.replaceAll(" ", "+"); content = content.replaceAll(" ", "+");
} }
String str = AESUtil.decryptAfterBase64Decode(content, Constants.AES_KEY); String str = AesUtil.decryptAfterBase64Decode(content, Constants.AES_KEY);
if (null == str || !str.equals(userId.toString())) { if (null == str || !str.equals(userId.toString())) {
return JsonResult.buildErrorStateResult("解密有误", null); return JsonResult.buildErrorStateResult("解密有误", null);
} }
......
...@@ -15,7 +15,7 @@ import javax.crypto.spec.SecretKeySpec; ...@@ -15,7 +15,7 @@ import javax.crypto.spec.SecretKeySpec;
* @version 1.0 * @version 1.0
*/ */
@Slf4j @Slf4j
public class AESUtil { public class AesUtil {
/** /**
* KEY算法 * KEY算法
...@@ -60,7 +60,7 @@ public class AESUtil { ...@@ -60,7 +60,7 @@ public class AESUtil {
*/ */
private static byte[] decryptAfterBase64DecodeToByte(String data, String key) { private static byte[] decryptAfterBase64DecodeToByte(String data, String key) {
try { try {
if (key == null || "".equals(key.trim().length())) { if (StringUtils.isBlank(key)) {
return null; return null;
} }
byte[] raw = key.getBytes(DATA_ENCODING); byte[] raw = key.getBytes(DATA_ENCODING);
......
...@@ -2,12 +2,11 @@ package common; ...@@ -2,12 +2,11 @@ package common;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Random;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.util.AESUtil; import cn.quantgroup.xyqb.util.AesUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.RandomStringUtils; import org.apache.commons.lang.RandomStringUtils;
import org.junit.Assert; import org.junit.Assert;
...@@ -39,7 +38,7 @@ public class TestJdk8 { ...@@ -39,7 +38,7 @@ public class TestJdk8 {
@Test @Test
public void wechatContent() { public void wechatContent() {
String userId = String.valueOf(50963791); String userId = String.valueOf(50963791);
String content = AESUtil.encryptAndBase64Encode(userId, Constants.AES_KEY); String content = AesUtil.encryptAndBase64Encode(userId, Constants.AES_KEY);
log.info("50963791:{}", content); log.info("50963791:{}", content);
} }
......
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