|
@@ -143,22 +143,24 @@ public class WeChatService {
|
|
|
byte[] keyByte = Base64.decodeBase64(key);
|
|
|
// 偏移量
|
|
|
byte[] ivByte = Base64.decodeBase64(iv);
|
|
|
- try {
|
|
|
+// try {
|
|
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding");
|
|
|
SecretKeySpec spec = new SecretKeySpec(keyByte, "AES");
|
|
|
AlgorithmParameters parameters = AlgorithmParameters.getInstance("AES");
|
|
|
+
|
|
|
parameters.init(new IvParameterSpec(ivByte));
|
|
|
// 初始化
|
|
|
cipher.init(Cipher.DECRYPT_MODE, spec, parameters);
|
|
|
byte[] resultByte = cipher.doFinal(dataByte);
|
|
|
+
|
|
|
if (null != resultByte && resultByte.length > 0) {
|
|
|
return new String(resultByte, encodingFormat);
|
|
|
}
|
|
|
return null;
|
|
|
- } catch (Exception e) {
|
|
|
+ /*} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- }
|
|
|
- return null;
|
|
|
+ }*/
|
|
|
+// return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -204,6 +206,8 @@ public class WeChatService {
|
|
|
// 发送post请求读取调用微信接口获取openid用户唯一标识
|
|
|
String infos;
|
|
|
try {
|
|
|
+ log.info("requestUrl--------------------------"+requestUrl);
|
|
|
+ log.info("requestUrlParam--------------------------"+requestUrlParam);
|
|
|
infos = RequestUtil.sendPost(requestUrl, requestUrlParam);
|
|
|
} catch (Exception e) {
|
|
|
return ResponseJson.error("服务器内部异常", returnMap);
|