1 回复
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)}`
}
}