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是寂静受权