收藏
回答

按照教程配置微信授权链接,登录提示缺少appid

最后一次编辑于  2020-12-10
回答关注问题邀请回答
收藏

1 个回答

  • 贩卖焦虑
    贩卖焦虑
    2020-12-11
    goLogin: function (redirect = window.location.href) {
       // `${window.location.origin}${window.location.pathname}`)
       if (this.isWeiXin()) {
          let appid = 'wx1234567890'
          let redirect_domain = encodeURIComponent('https://a.b.com') //服务器地址
          let rdu = encodeURIComponent(encodeURIComponent(`${window.location.origin}/app/loading?redirect_uri=${redirect}`))
          let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect_domain}/你们的接口地址?rdu=${rdu}&response_type=code&scope=snsapi_userinfo&state=state#wechat_redirect`
           window.location.href = url
        } else {
          window.location.href = `/app/login?redirect_uri=${encodeURIComponent(redirect)}`
        }
     }
    
    2020-12-11
    有用
    回复
登录 后发表内容
问题标签