Sfoglia il codice sorgente

特殊字符异常处理

zhouy 11 mesi fa
parent
commit
8c38e01072

+ 44 - 44
qywx-sdk/src/main/java/com/usoftchina/qywx/sdk/weixin/AesException.java

@@ -1,59 +1,59 @@
-package com.usoftchina.qywx.sdk.weixin;
+package com.usoftchina.qywx.sdk.weixin;
 
 @SuppressWarnings("serial")
 public class AesException extends Exception {
 
-	public final static int OK = 0;
-	public final static int ValidateSignatureError = -40001;
-	public final static int ParseXmlError = -40002;
-	public final static int ComputeSignatureError = -40003;
-	public final static int IllegalAesKey = -40004;
-	public final static int ValidateCorpidError = -40005;
-	public final static int EncryptAESError = -40006;
-	public final static int DecryptAESError = -40007;
-	public final static int IllegalBuffer = -40008;
-	//public final static int EncodeBase64Error = -40009;
-	//public final static int DecodeBase64Error = -40010;
-	//public final static int GenReturnXmlError = -40011;
+    public final static int OK = 0;
+    public final static int ValidateSignatureError = -40001;
+    public final static int ParseXmlError = -40002;
+    public final static int ComputeSignatureError = -40003;
+    public final static int IllegalAesKey = -40004;
+    public final static int ValidateCorpidError = -40005;
+    public final static int EncryptAESError = -40006;
+    public final static int DecryptAESError = -40007;
+    public final static int IllegalBuffer = -40008;
+    //public final static int EncodeBase64Error = -40009;
+    //public final static int DecodeBase64Error = -40010;
+    //public final static int GenReturnXmlError = -40011;
 
-	private int code;
+    private int code;
 
-	private static String getMessage(int code) {
-		switch (code) {
-		case ValidateSignatureError:
-			return "签名验证错误";
-		case ParseXmlError:
-			return "xml解析失败";
-		case ComputeSignatureError:
-			return "sha加密生成签名失败";
-		case IllegalAesKey:
-			return "SymmetricKey非法";
-		case ValidateCorpidError:
-			return "corpid校验失败";
-		case EncryptAESError:
-			return "aes加密失败";
-		case DecryptAESError:
-			return "aes解密失败";
-		case IllegalBuffer:
-			return "解密后得到的buffer非法";
+    private static String getMessage(int code) {
+        switch (code) {
+            case ValidateSignatureError:
+                return "签名验证错误";
+            case ParseXmlError:
+                return "xml解析失败";
+            case ComputeSignatureError:
+                return "sha加密生成签名失败";
+            case IllegalAesKey:
+                return "SymmetricKey非法";
+            case ValidateCorpidError:
+                return "corpid校验失败";
+            case EncryptAESError:
+                return "aes加密失败";
+            case DecryptAESError:
+                return "aes解密失败";
+            case IllegalBuffer:
+                return "解密后得到的buffer非法";
 //		case EncodeBase64Error:
 //			return "base64加密错误";
 //		case DecodeBase64Error:
 //			return "base64解密错误";
 //		case GenReturnXmlError:
 //			return "xml生成失败";
-		default:
-			return null; // cannot be
-		}
-	}
+            default:
+                return null; // cannot be
+        }
+    }
 
-	public int getCode() {
-		return code;
-	}
+    public int getCode() {
+        return code;
+    }
 
-	AesException(int code) {
-		super(getMessage(code));
-		this.code = code;
-	}
+    AesException(int code) {
+        super(getMessage(code));
+        this.code = code;
+    }
 
-}
+}

+ 1 - 1
qywx-sdk/src/main/java/com/usoftchina/qywx/sdk/weixin/ByteGroup.java

@@ -1,5 +1,4 @@
 package com.usoftchina.qywx.sdk.weixin;
-
 import java.util.ArrayList;
 
 class ByteGroup {
@@ -24,3 +23,4 @@ class ByteGroup {
 		return byteContainer.size();
 	}
 }
+

+ 0 - 8
qywx-sdk/src/main/java/com/usoftchina/qywx/sdk/weixin/SHA1.java

@@ -1,11 +1,3 @@
-/**
- * 对企业微信发送给企业后台的消息加解密示例代码.
- * 
- * @copyright Copyright (c) 1998-2014 Tencent Inc.
- */
-
-// ------------------------------------------------------------------------
-
 package com.usoftchina.qywx.sdk.weixin;
 
 import java.security.MessageDigest;

+ 0 - 1
uas-office-qywx/src/main/java/com/usoftchina/uas/office/qywx/manage/service/QywxCallbackService.java

@@ -1,6 +1,5 @@
 package com.usoftchina.uas.office.qywx.manage.service;
 
-import com.alibaba.fastjson.JSON;
 import com.fasterxml.jackson.dataformat.xml.XmlMapper;
 import com.usoftchina.qywx.sdk.DevSDK;
 import com.usoftchina.qywx.sdk.dto.GetProviderTokenResp;