调用微信静默授权接口

11次阅读

共计 469 个字符,预计需要花费 2 分钟才能阅读完成。

window.location.href=”https://open.weixin.qq.com/connect/oauth2/authorize?appid=” + appId + “&redirect_uri=”
+ encodeURIComponent(configApi.config.api+”live/webSilenceAuth?eventId=” + eventId +’&utm_source=’ + utm_source + “&targetUrl=” + encodeURIComponent(localUrl))
+”&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect”;
传递 appid 给微信,redirect_uri 是授权后重定向的回调链接地址,请使用 encodeURIComponent 解码对链接进行处理。这里的 redirect_uri 是向后台请求接口,并且把我想要传递给后台的参数都传过去。然后后台再返回东西给前端。scope=snsapi_base 是静默授权

正文完
 0