|
Action action = new Action();
action.setName("getUserId");
action.setParameter("userCode", userCode);
ActionResult result = WxHelper.invokeAction(action, req);
if (result.isSuccess()) {
JSONObject json = (JSONObject) result.getDatas().get(0);
String userId = json.getString("value");
logger.info(userId);
return userId;
} else {
throw new RuntimeException(result.getMessage());
}
我们用上面的代码进行微信单点登陆,提示
Caused by: java.lang.RuntimeException: 微信错误 errcode=40029, errmsg=invalid code, hint: [1568876164_39_d1892518db076b5e32478323df4c425b], from ip: 221.226.5.140, more info at https://open.work.weixin.qq.com/devtool/query?e=40029
json:{"errcode":40029,"errmsg":"invalid code, hint: [1568876164_39_d1892518db076b5e32478323df4c425b], from ip: 221.226.5.140, more info at https://open.work.weixin.qq.com/devtool/query?e=40029"}
at Oauth2Task.getUserId(Oauth2Task.java:100)
更奇怪的是生产服不报这样的错,测试服就报这样的错,请问这是为什么?
|
|