我的报这个错的时候,把url改成下面这个就可以了,
“https://api.weixin.qq.com/sns/jscode2session?appid=$appid&secret=$appsecret&js_code=$code&grant_type=authorization_code”
这个url有三种
1、url=“https://api.weixin.qq.com/sns/oauth2/accesstoken?appid=url = “https://api.weixin.qq.com/sns/oauth2/access_token?appid=url=“https://api.weixin.qq.com/sns/oauth2/accesstoken?appid=appid&secret=$appsecret&code=$code&grant_type=authorization_code”;
2、url=“https://api.weixin.qq.com/sns/oauth2/component/accesstoken?appid=url = “https://api.weixin.qq.com/sns/oauth2/component/access_token?appid=url=“https://api.weixin.qq.com/sns/oauth2/component/accesstoken?appid=appid&secret=$appsecret&code=$code&grant_type=authorization_code”;
3、url=“https://api.weixin.qq.com/sns/jscode2session?appid=url = “https://api.weixin.qq.com/sns/jscode2session?appid=url=“https://api.weixin.qq.com/sns/jscode2session?appid=appid&secret=$appsecret&js_code=$code&grant_type=authorization_code”;