Commit 4aad1a62 authored by youjie's avatar youjie

优化自动登录

parent 9f1a5668
......@@ -1357,18 +1357,6 @@
}
this.U = uni.getStorageSync("mall_UserInfo");
this.b2bUser = uni.getStorageSync("b2b_user");
this.customer = this.b2bUser
this.getDetails();
let basedata = uni.getStorageSync("basedata");
//判断后台是否开启自动授权
if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting && basedata.mall.setting.is_show_auth ==
1) {
this.is_show_auth = 1;
}
let that = this;
uni.getSystemInfo({
success(res) {
......@@ -1381,9 +1369,20 @@
},
});
this.mainColor = this.$uiConfig.mainColor;
this.getSale()
},
onShow(){
this.U = uni.getStorageSync("mall_UserInfo");
this.b2bUser = uni.getStorageSync("b2b_user");
this.customer = this.b2bUser
this.getDetails();
this.getSale()
let basedata = uni.getStorageSync("basedata");
//判断后台是否开启自动授权
if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting && basedata.mall.setting.is_show_auth ==
1) {
this.is_show_auth = 1;
}
if (!this.U) {
this.U = {
nickName: "未登录",
......
......@@ -128,11 +128,14 @@ export default {
curPage.onShow()
// curPage.onReady()
}else{
console.log(uni.getStorageSync("LoginState"),'---log')
if(uni.getStorageSync("LoginState")) return
uni.setStorageSync("LoginState",true)
setTimeout(()=>{
uni.redirectTo({
url: '/pages/index/index'
})
},1000)
}
} else if (res.data.resultCode != 1) {
if (!failed) {
......
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