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是靜默授權