Commit 4aad1a62 authored by youjie's avatar youjie

优化自动登录

parent 9f1a5668
...@@ -1357,18 +1357,6 @@ ...@@ -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; let that = this;
uni.getSystemInfo({ uni.getSystemInfo({
success(res) { success(res) {
...@@ -1381,9 +1369,20 @@ ...@@ -1381,9 +1369,20 @@
}, },
}); });
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.getSale()
}, },
onShow(){ 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) { if (!this.U) {
this.U = { this.U = {
nickName: "未登录", nickName: "未登录",
......
...@@ -128,11 +128,14 @@ export default { ...@@ -128,11 +128,14 @@ export default {
curPage.onShow() curPage.onShow()
// curPage.onReady() // curPage.onReady()
}else{ }else{
console.log(uni.getStorageSync("LoginState"),'---log')
if(uni.getStorageSync("LoginState")) return if(uni.getStorageSync("LoginState")) return
uni.setStorageSync("LoginState",true) uni.setStorageSync("LoginState",true)
uni.redirectTo({ setTimeout(()=>{
url: '/pages/index/index' uni.redirectTo({
}) url: '/pages/index/index'
})
},1000)
} }
} else if (res.data.resultCode != 1) { } else if (res.data.resultCode != 1) {
if (!failed) { 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