diff --git a/components/loginPopup.vue b/components/loginPopup.vue index b88520e..b5412d2 100644 --- a/components/loginPopup.vue +++ b/components/loginPopup.vue @@ -151,27 +151,28 @@ // 获取用户信息 getUserInfoFun() { getUserInfo().then(res => { - if (res.user && res.user.barId) { + if (res.user) { this.userInfo = res.user uni.setStorageSync('userInfo', res.user) this.$emit('loginSuccess') - } else { - // 移除自动关闭弹窗的逻辑 - uni.showModal({ - title: '提示', - content: '您还未认证门店,请先认证', - showCancel: true, - success: (res) => { - if (res.confirm) { - console.log('确定') - uni.navigateTo({ - url: '/pages/index/registration?openId=' + this.openId - }) + + // 如果没有barId,提示去认证 + if (!res.user.barId) { + uni.showModal({ + title: '提示', + content: '您还未认证门店,请先认证', + showCancel: true, + success: (res) => { + if (res.confirm) { + console.log('确定') + uni.navigateTo({ + url: '/pages/index/registration?openId=' + this.openId + }) + } } - } - }) + }) + } } - uni.hideLoading() }) }, diff --git a/pages/index/my.vue b/pages/index/my.vue index c6e2907..b397c6c 100644 --- a/pages/index/my.vue +++ b/pages/index/my.vue @@ -1,6 +1,6 @@