收藏
回答

jscode2session接口根据code去请求,但是返回空字符串 ""

// 微信小程序ID
String appid = "";
// 微信小程序秘钥
String secret = "";

// 根据小程序穿过来的code想这个url发送请求
String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appid + "&secret=" + secret + "&js_code=" + code + "&grant_type=authorization_code";
// 发送请求,返回Json字符串
String str = WxmpUtil.httpRequest(url, "GET", null);


f返回 JSON字符串为""


回答关注问题邀请回答
收藏
登录 后发表内容
问题标签