Commit 9b9ecde8 authored by youjie's avatar youjie

修复登录

parent fa516890
......@@ -59,7 +59,7 @@
</template>
<coupon v-if="showCoupons" :coupon-message="couponMessage" :cform="ComeFrom"
@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>
</view>
</view>
......@@ -114,7 +114,8 @@
ComeFrom: "",
safeTop: 0,
isNavPosition: 0,
scrollTop: 0
scrollTop: 0,
is_show_auth: 0,
};
},
components: {
......@@ -159,11 +160,7 @@
}
}
const mu = uni.getStorageSync('mall_UserInfo')
const bu = uni.getStorageSync('b2b_user')
if (!mu || !bu) this.showAuth = true
this.tokenIsExpire()
this.init()
uni.showNavigationBarLoading();
if (uni.getStorageSync('coupons')) {
......@@ -219,9 +216,20 @@
}, 500);
this.mainColor = this.$uiConfig.mainColor;
this.$utils.VersionUpdate()
const mu = uni.getStorageSync('mall_UserInfo')
const bu = uni.getStorageSync('b2b_user')
if (!mu || !bu) this.showAuth = true
},
methods: {
tokenIsExpire(){
this.apipost('b2b_post_CheckMiniAppToken',{},
(res)=>{
if(res.resultCode==1){}
})
},
startb() {
this.showStart = false;
if (innerAudioContext != undefined) {
......@@ -284,23 +292,27 @@
url: '/pages/index/index'
})
},
init() {
const parameter = {VipCusType:1,page_id: this.pageId}
// #ifdef MP-DI
parameter.VipCusType = 2
init() {
const parameter = {VipCusType:1,page_id: this.pageId}
// #ifdef MP-DI
parameter.VipCusType = 2
// #endif
this.request2({
url: "/api/Mall/GetHome",
data: parameter,
},
(res) => {
this.myPageData = res.data;
if(this.pageId==0){
uni.setStorageSync('navs',this.myPageData.navbar.navs)
this.myPageData = res.data;
if(this.pageId==0){
uni.setStorageSync('navs',this.myPageData.navbar.navs)
}
uni.setStorageSync("basedata", res.data);
if (res.data && res.data.mall && 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();
if (this.pageId == 0) {
......@@ -344,6 +356,7 @@
reloadUserinfo() {
this.u = uni.getStorageSync("mall_UserInfo");
this.init();
uni.removeStorageSync("LoginState")
},
gbAuth() {
this.showAuth = false;
......
......@@ -706,7 +706,7 @@
}
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) {
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