Commit c08bc570 authored by 肖健's avatar 肖健

bug修复

parent f8901bb9
...@@ -107,10 +107,10 @@ export default { ...@@ -107,10 +107,10 @@ export default {
code: code, code: code,
} }
let opts = { url: '/xcx/code/session', method: 'post' } let opts = { url: '/xcx/code/session', method: 'post' }
await that.http.httpRequest(opts, param).then(res => { await that.http.httpRequest(opts, param).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
that.openid = res.data.data.openid that.openid = res.data.data.openid
uni.setStorageSync('openid', that.openid);
} }
}) })
}, },
...@@ -200,7 +200,11 @@ export default { ...@@ -200,7 +200,11 @@ export default {
}, },
}, },
onLoad(e) { //默认加载 onLoad(e) { //默认加载
this.wechatLogin() let openid = uni.getStorageSync('openid');
if(!openid) {
this.wechatLogin()
}
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
if(e.scene) { if(e.scene) {
......
...@@ -126,6 +126,7 @@ export default { ...@@ -126,6 +126,7 @@ export default {
if (res.data.code == 200) { if (res.data.code == 200) {
uni.removeStorageSync('userToken') uni.removeStorageSync('userToken')
uni.removeStorageSync('xcxIndexPath') uni.removeStorageSync('xcxIndexPath')
uni.removeStorageSync('openid')
uni.navigateTo({ uni.navigateTo({
url: '/pages/binding/index' url: '/pages/binding/index'
......
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