Skip to content

Commit

Permalink
Merge pull request #4 from chengn/master
Browse files Browse the repository at this point in the history
修改入口
  • Loading branch information
chengn committed Dec 12, 2014
2 parents 1622c31 + e625f13 commit 005db5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/org/sword/wechat4j/WechatSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.sword.wechat4j.response.VideoResponse;
import org.sword.wechat4j.response.VoiceResponse;
import org.sword.wechat4j.response.WechatResponse;
import org.sword.wechat4j.util.Config;
import org.sword.wechat4j.util.JaxbParser;
import org.sword.wechat4j.util.StreamUtils;

Expand All @@ -36,7 +37,6 @@ public abstract class WechatSupport {
Logger logger = Logger.getLogger(WechatSupport.class);

private HttpServletRequest request;
private String token;

protected WechatRequest wechatRequest;
protected WechatResponse wechatResponse;
Expand All @@ -47,9 +47,8 @@ public abstract class WechatSupport {
* @param request 微信服务发过来的http请求
* @param token token
*/
public WechatSupport(HttpServletRequest request,String token){
public WechatSupport(HttpServletRequest request){
this.request = request;
this.token = token;
this.wechatRequest = new WechatRequest();
this.wechatResponse = new WechatResponse();
}
Expand All @@ -65,9 +64,10 @@ public String execute(){
String timestamp = param.getTimestamp();
String nonce = param.getNonce();
String echostr = param.getEchostr();
String token = Config.instance().getToken();

ValidateSignature validateSignature = new ValidateSignature(signature,
timestamp, nonce, this.token);
timestamp, nonce, token);
if(!validateSignature.check()){
return "error";
}
Expand Down
4 changes: 2 additions & 2 deletions test/org/sword/wechat4j/Wechat.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/
public class Wechat extends WechatSupport{

public Wechat(HttpServletRequest request, String token) {
super(request, token);
public Wechat(HttpServletRequest request) {
super(request);
}

@Override
Expand Down

0 comments on commit 005db5c

Please sign in to comment.