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是静默受权前端