网址这样写可以吗,显示此链接无法访问。参数对了好几遍了。JS接口安全域名为
www.wodeschool.cn
function jump_author() {
var appid="wx8d03b75a183070f8";
var redirect_uri="http://www.wodeschool.cn/view/student";
redirect_uri=encodeURI(redirect_uri);
location.href="https://open.weixin.qq.com/connect/oauth2/authorize?appid="+appid+"&redirect_uri="+redirect_uri+"&response_type=code&scope=snsapi_userinfo&state=123#wechat_redirect";
}
encodeURI改为encodeURIComponent,encodeURI不会编码:/这些字符,导致url验证失败了吧。。
redirect_uri=encodeURI(redirect_uri);
==>
redirect_uri=encodeURIComponent(redirect_uri);