微信公众号如何获取openid


如何获取openid
(微信公众号配置,略)
先获取code,在根据code就能获取 openid


1.登录的时候,前台页面直接跳转(一个微信的接口地址)页面

var APPID = "";
var url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+APPID
+"&redirect_uri= http%3A%2F%2Fwww.scidream.net%2FRepairSystem%2FweixinCust%2FgetWeixinCode"
+"&response_type=code&scope=snsapi_base&state="+obj.data.customerID+"#wechat_redirect";
window.location.href=url; 

redirect_uri后面是你处理的(方法)地址,就是code的接收地址

URL中的字符只能是ASCII字符 (红字

2.获取code,根据code获取openid 在存起来




猜你喜欢

转载自blog.csdn.net/qq_36073929/article/details/79379969