diff --git a/pages/auth.vue b/pages/auth.vue index 772be79..522438a 100644 --- a/pages/auth.vue +++ b/pages/auth.vue @@ -17,7 +17,21 @@ export default { if (!code) { this.notice = '

非法访问,缺少授权参数"code"。



返回首页'; this.$finishLoad(); return } if (type === 'weixin') { + const { data } = await this.$axios.post(`${process.env.baseURL}/visitor/user/weixin`, { + code, + app: 'wx9d5e677f533d1e84' + }) + if (data.status !== 1) { + this.$toasted.show('微信登录失败,请重试或换用其它登录方式。', { + position: 'top-center', + duration: 5000 + }) + return + } + + window.authSuccess(data) + return } const { data } = await this.$axios.post('/visitor/user/auth', {