添加微信登录
This commit is contained in:
parent
687f5c5c68
commit
209d25f204
@ -636,9 +636,21 @@ export default {
|
|||||||
type: 'get',
|
type: 'get',
|
||||||
url: 'https://weixin.openapi.site/check?uuid=' + uuid + (last ? '&last=' + last : ''),
|
url: 'https://weixin.openapi.site/check?uuid=' + uuid + (last ? '&last=' + last : ''),
|
||||||
timeout: 6e4
|
timeout: 6e4
|
||||||
}).then((res) => {
|
}).then(async (res) => {
|
||||||
if (res.data.status === 405) {
|
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) {
|
} else if (res.data.status === 404) {
|
||||||
this.getCode(uuid, res.data.result.wxErrCode)
|
this.getCode(uuid, res.data.result.wxErrCode)
|
||||||
} else if (res.data.status === 403) {
|
} else if (res.data.status === 403) {
|
||||||
@ -676,7 +688,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.commentLoading = false
|
this.commentLoading = false
|
||||||
this.currentLoginType = null
|
this.currentLoginType = null
|
||||||
this.$toasted.show('获取微信登录所需参数错误,请暂时换用其它登录方式或重试。', {
|
this.$toasted.show('获取微信登录所需参数错误,请重试或换用其它登录方式。', {
|
||||||
position: 'top-center',
|
position: 'top-center',
|
||||||
duration: 5000
|
duration: 5000
|
||||||
})
|
})
|
||||||
@ -685,7 +697,7 @@ export default {
|
|||||||
this.commentLoading = false
|
this.commentLoading = false
|
||||||
this.currentLoginType = null
|
this.currentLoginType = null
|
||||||
this.useWeixinLogin = false
|
this.useWeixinLogin = false
|
||||||
this.$toasted.show('暂时无法使用Github登录,请尝试其它登录方式或重试。', {
|
this.$toasted.show('暂时无法使用Github登录,请重试或换用其它登录方式。', {
|
||||||
position: 'top-center',
|
position: 'top-center',
|
||||||
duration: 5000
|
duration: 5000
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user