挪用微信寂静受权接口

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

    原文作者:houqq
    原文地址: https://segmentfault.com/a/1190000018811757
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞