index.js 508 B

12345678
  1. import settings from "../../settings"
  2. export const getAuthen = () =>{
  3. console.log(this)
  4. const path = window.location.pathname === "/authen" ? "/" : window.location.pathname
  5. const search = window.location.search.replace("?",".").replace(/&/g,"-").replace(/=/g,"_")
  6. window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + settings.appId + "&redirect_uri=" + settings.url + "%2fauthen&response_type=code&scope=snsapi_userinfo&state="+ path + search +"#wechat_redirect"
  7. }