Commit 9a0bda86 authored by Facius's avatar Facius

Merge branch 'dev-v1.0.0' of https://git.banshouhui.com/wuzhenzhe/study into dev-v1.0.0

parents 3465b4ce 75b5cf5f
......@@ -35,7 +35,7 @@ export default {
return {
title: '微信授权登录',
host: '', //配置为自己的额服务器即可
back: false, //跳回页面
returnUrl: '', //跳回页面
}
},
computed: {
......@@ -44,9 +44,7 @@ export default {
},
},
onLoad(params) {
if (params && params.back) {
this.back = true
}
this.returnUrl = params?.path
},
methods: {
wxLogin() {
......@@ -73,19 +71,21 @@ export default {
})
this.$u.api.loginWechatAuth(data).then((res) => {
uni.hideLoading()
if (this.back) {
this.$u.route({
type: 'back',
})
return
}
this.$u.vuex('vuex_token', res.token)
this.$u.vuex('openId', res.openId)
this.$u.vuex('userInfo', userInfo)
this.$u.route({
url: '/pages/index/index',
type: 'tab',
})
if (this.returnUrl) {
this.$u.route({
url: this.returnUrl,
type: 'redirectTo',
})
} else {
this.$u.route({
url: '/pages/index/index',
type: 'tab',
})
}
})
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment