微信公众号的用户同意授权,获取code(前端)

window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=

(这个appid后端会给你)&redirect_uri=http://192.168什么什么的/pages/index/index(这里的地址填写自己本地的,注意是否是hash模式,#不能用)&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'

你可能感兴趣的:(微信公众号的用户同意授权,获取code(前端))