diff --git a/pages/post/_id.vue b/pages/post/_id.vue index 10586ba..0b93f14 100644 --- a/pages/post/_id.vue +++ b/pages/post/_id.vue @@ -636,9 +636,21 @@ export default { type: 'get', url: 'https://weixin.openapi.site/check?uuid=' + uuid + (last ? '&last=' + last : ''), timeout: 6e4 - }).then((res) => { + }).then(async (res) => { if (res.data.status === 405) { - alert(res.data.result.code) + const { data } = await this.$axios.post(`${process.env.baseURL}/visitor/user/weixin`, { + code: res.data.result.code + }) + + if (data.status !== 1) { + this.$toasted.show('微信登录失败,请重试或换用其它登录方式。', { + position: 'top-center', + duration: 5000 + }) + return + } + + window.authSuccess(data) } else if (res.data.status === 404) { this.getCode(uuid, res.data.result.wxErrCode) } else if (res.data.status === 403) { @@ -676,7 +688,7 @@ export default { } else { this.commentLoading = false this.currentLoginType = null - this.$toasted.show('获取微信登录所需参数错误,请暂时换用其它登录方式或重试。', { + this.$toasted.show('获取微信登录所需参数错误,请重试或换用其它登录方式。', { position: 'top-center', duration: 5000 }) @@ -685,7 +697,7 @@ export default { this.commentLoading = false this.currentLoginType = null this.useWeixinLogin = false - this.$toasted.show('暂时无法使用Github登录,请尝试其它登录方式或重试。', { + this.$toasted.show('暂时无法使用Github登录,请重试或换用其它登录方式。', { position: 'top-center', duration: 5000 })