功能:在当前页面授权,然后授权成功之后回到当前的页面
const appid = res.data.data//要授权公众号的appid
const url = window.location.href;//当前的url路径
let urls = encodeURIComponent(url); //路径转码
window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + urls + '&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'