webAuth.js 411 B

1234567891011
  1. let webAuth = {}
  2. let appId = 'wxdad9b7d8e7750457';
  3. // let appId = 'wx8c652a58fa587178'; //测试号
  4. let scope = 'snsapi_userinfo'
  5. webAuth.getUserOpenid = (url) => {
  6. console.log("url",decodeURIComponent(url))
  7. window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${url}&response_type=code&scope=${scope}&state=STATE#wechat_redirect`
  8. }
  9. export default webAuth;