|
|
@ -4,10 +4,7 @@ import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.http.HttpRequest; |
|
|
|
import com.alibaba.fastjson.JSONException; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.ccsens.util.DateUtil; |
|
|
|
import com.ccsens.util.JacksonUtil; |
|
|
|
import com.ccsens.util.RedisUtil; |
|
|
|
import com.ccsens.util.WebConstant; |
|
|
|
import com.ccsens.util.*; |
|
|
|
import com.ccsens.util.bean.wx.po.WxAccessToken; |
|
|
|
import com.ccsens.util.bean.wx.po.WxOauth2AccessToken; |
|
|
|
import com.ccsens.util.bean.wx.po.WxOauth2UserInfo; |
|
|
@ -83,8 +80,11 @@ public class WxGzhUtil { |
|
|
|
private static final String APPID = "wx7af1bf1e14facf82"; |
|
|
|
private static final String SECRET = "a6613fae11b497639c0224b820aaf6d9"; |
|
|
|
|
|
|
|
private static final String APPID_H5 = "wxd1842e073e0e6d91"; |
|
|
|
private static final String SECRET_H5 = "96d69b79039caf92a2abafa999880cad"; |
|
|
|
private static final String APPID_H5_TEST = "wxd1842e073e0e6d91"; |
|
|
|
private static final String SECRET_H5_TEST = "96d69b79039caf92a2abafa999880cad"; |
|
|
|
|
|
|
|
private static final String APPID_H5 = "wxb842be1cf4c5cf78"; |
|
|
|
private static final String SECRET_H5 = "ae9ec99c4fbbc7042b90698c3d05e21b"; |
|
|
|
|
|
|
|
private static final String appid_health = "wx2f9ef33e08053bbf"; |
|
|
|
private static final String secret_health = "af90801c26bc177681b2c39a603605b9"; |
|
|
@ -129,6 +129,8 @@ public class WxGzhUtil { |
|
|
|
switch (identifyType){ |
|
|
|
case Wx_H5: |
|
|
|
return APPID_H5; |
|
|
|
case Wx_H5_TEST: |
|
|
|
return APPID_H5_TEST; |
|
|
|
case OAUTH2_Wx: |
|
|
|
default: |
|
|
|
return APPID; |
|
|
@ -139,6 +141,8 @@ public class WxGzhUtil { |
|
|
|
switch (identifyType){ |
|
|
|
case Wx_H5: |
|
|
|
return SECRET_H5; |
|
|
|
case Wx_H5_TEST: |
|
|
|
return SECRET_H5_TEST; |
|
|
|
case OAUTH2_Wx: |
|
|
|
default: |
|
|
|
return SECRET; |
|
|
@ -347,6 +351,9 @@ public class WxGzhUtil { |
|
|
|
* @throws BaseException 异常 |
|
|
|
*/ |
|
|
|
public static WxOauth2UserInfo getOauth2UserInfo(WebConstant.IDENTIFY_TYPE identifyType,String code) throws BaseException { |
|
|
|
if (StrUtil.isNotBlank(PropUtil.wxH5) && PropUtil.wxH5.equals("0")){ |
|
|
|
identifyType = WebConstant.IDENTIFY_TYPE.Wx_H5_TEST; |
|
|
|
} |
|
|
|
WxOauth2AccessToken wxOauth2AccessToken = getOauth2AccessToken(identifyType,code); |
|
|
|
return getOauth2UserInfo(wxOauth2AccessToken.getAccessToken(),wxOauth2AccessToken.getOpenId()); |
|
|
|
} |
|
|
|