Commit 0ea29768 authored by Morson's avatar Morson

登录逻辑调整

parent 8cb91d7e
......@@ -145,8 +145,12 @@ export default {
wxAppNo: that.globalData.wxAppNo, // 自营平台小程序
};
let result = await that.$u.api.loginWechatAuth(params)
if (result && result.code == 200 && result.data) {
if (result && result.code == 200 && result.data && result.data.token) {
that.setUserData(result.data);
} else {
uni.navigateTo({
url: "pages/login/index"
})
}
} else {
uni.showModal({
......
......@@ -99,15 +99,15 @@ export default {
return login.authorization(params);
}).then(res => {
uni.hideLoading();
if (res) {
if (res && res.code == 200 && res.data && res.data.token) {
that.setUserData(res.data)
that.goBackPage()
} else {
this.setLoginStatus()
that.setLoginStatus()
}
}).catch(res => {
uni.hideLoading()
this.setLoginStatus()
that.setLoginStatus()
})
},
......
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