Commit 8a830d6f authored by shiyu's avatar shiyu

token

parent b3e971d6
...@@ -133,6 +133,15 @@ public class WxLoginManager { ...@@ -133,6 +133,15 @@ public class WxLoginManager {
public String getAccessToken() { public String getAccessToken() {
//测试环境
if (!GET_ACCESS_TOKEN_URL.contains("stable_token")) {
String accessTokenUrl = String.format(GET_ACCESS_TOKEN_URL, APPLET_APPID, APPLET_APP_SECRET);
String res = OkHttpUtil.builder().url(accessTokenUrl)
.get().sync();
String token = JsonUtils.getValueByPath(res, "access_token");
return token;
}
//根据商户的appid从redis中获取商户的token //根据商户的appid从redis中获取商户的token
String token = redisUtils.hasKey(APPLET_APPID)? redisUtils.get(APPLET_APPID).toString() : null; String token = redisUtils.hasKey(APPLET_APPID)? redisUtils.get(APPLET_APPID).toString() : null;
if (com.xxdxxs.utils.StringUtils.isEmpty(token)) { if (com.xxdxxs.utils.StringUtils.isEmpty(token)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment