diff --git a/cloud-common-wechat/src/main/java/com/cm/common/wechat/manager/officialaccount/WechatOfficialAccountManager.java b/cloud-common-wechat/src/main/java/com/cm/common/wechat/manager/officialaccount/WechatOfficialAccountManager.java index 28e41ea..16d71af 100644 --- a/cloud-common-wechat/src/main/java/com/cm/common/wechat/manager/officialaccount/WechatOfficialAccountManager.java +++ b/cloud-common-wechat/src/main/java/com/cm/common/wechat/manager/officialaccount/WechatOfficialAccountManager.java @@ -121,7 +121,7 @@ public class WechatOfficialAccountManager { * @param session */ public void setUserAccessToken(String code, String state, HttpSession session) throws Exception { - if (StringUtils.equals(state, wechatOfficialAccountProperties.getAuthorize().getState())) { + if (StringUtils.startsWith(state, wechatOfficialAccountProperties.getAuthorize().getState())) { WechatOfficialAccountAccessTokenForUser wechatOfficialAccountAccessTokenForUser = getUserAccessToken(code); WechatOfficialAccountUserInfo wechatOfficialAccountUserInfo = getUserInfo(wechatOfficialAccountAccessTokenForUser.getAccess_token(), wechatOfficialAccountAccessTokenForUser.getOpenid()); WechatOfficialAccountUser wechatOfficialAccountUser = new WechatOfficialAccountUser();