Commit 9b9ecde8 authored by youjie's avatar youjie

修复登录

parent fa516890
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
</template> </template>
<coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom" <coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom"
@goLook="()=>showCoupons = false" @closeBtn="()=>showCoupons = false"></coupon> @goLook="()=>showCoupons = false" @closeBtn="()=>showCoupons = false"></coupon>
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth> <auth v-if="showAuth&&is_show_auth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
<official-account></official-account> <official-account></official-account>
</view> </view>
</view> </view>
...@@ -114,7 +114,8 @@ ...@@ -114,7 +114,8 @@
ComeFrom: "", ComeFrom: "",
safeTop: 0, safeTop: 0,
isNavPosition: 0, isNavPosition: 0,
scrollTop: 0 scrollTop: 0,
is_show_auth: 0,
}; };
}, },
components: { components: {
...@@ -159,11 +160,7 @@ ...@@ -159,11 +160,7 @@
} }
} }
const mu = uni.getStorageSync('mall_UserInfo') this.tokenIsExpire()
const bu = uni.getStorageSync('b2b_user')
if (!mu || !bu) this.showAuth = true
this.init() this.init()
uni.showNavigationBarLoading(); uni.showNavigationBarLoading();
if (uni.getStorageSync('coupons')) { if (uni.getStorageSync('coupons')) {
...@@ -219,9 +216,20 @@ ...@@ -219,9 +216,20 @@
}, 500); }, 500);
this.mainColor = this.$uiConfig.mainColor; this.mainColor = this.$uiConfig.mainColor;
this.$utils.VersionUpdate() this.$utils.VersionUpdate()
const mu = uni.getStorageSync('mall_UserInfo')
const bu = uni.getStorageSync('b2b_user')
if (!mu || !bu) this.showAuth = true
}, },
methods: { methods: {
tokenIsExpire(){
this.apipost('b2b_post_CheckMiniAppToken',{},
(res)=>{
if(res.resultCode==1){}
})
},
startb() { startb() {
this.showStart = false; this.showStart = false;
if (innerAudioContext != undefined) { if (innerAudioContext != undefined) {
...@@ -301,6 +309,10 @@ ...@@ -301,6 +309,10 @@
uni.setStorageSync("basedata", res.data); uni.setStorageSync("basedata", res.data);
if (res.data && res.data.mall && res.data.mall.setting) { if (res.data && res.data.mall && res.data.mall.setting) {
this.setting = res.data.mall.setting; this.setting = res.data.mall.setting;
//判断后台是否开启自动授权
if (this.setting && this.setting.is_show_auth ==1) {
this.is_show_auth = 1;
}
} }
this.formatBg(); this.formatBg();
if (this.pageId == 0) { if (this.pageId == 0) {
...@@ -344,6 +356,7 @@ ...@@ -344,6 +356,7 @@
reloadUserinfo() { reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo"); this.u = uni.getStorageSync("mall_UserInfo");
this.init(); this.init();
uni.removeStorageSync("LoginState")
}, },
gbAuth() { gbAuth() {
this.showAuth = false; this.showAuth = false;
......
...@@ -706,7 +706,7 @@ ...@@ -706,7 +706,7 @@
} }
let basedata = uni.getStorageSync("basedata"); let basedata = uni.getStorageSync("basedata");
//判断后台是否开启自动授权 //判断后台是否开启自动授权
if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting && basedata.mall.setting.is_show_auth == if (basedata && basedata.mall && basedata.mall.setting && basedata.mall.setting.is_show_auth ==
1) { 1) {
this.is_show_auth = 1; this.is_show_auth = 1;
} }
......
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