diff --git a/src/components/utils/modules.js b/src/components/utils/modules.js index 43af3b8..2fea4da 100644 --- a/src/components/utils/modules.js +++ b/src/components/utils/modules.js @@ -69,6 +69,7 @@ export const user = { //checkType 1、登录认证 2、居民认证 3、党员认证 //判断是否需要校验认证信息 let {user: userInfo, token} = rootState + console.log(); if (!checkType) { //如果需要校验认证信息,必定要先验证是否登录 uni.navigateTo({url: modulePath}); @@ -93,6 +94,19 @@ export const user = { return uni.showToast({title: "您还不是党员,暂时无法使用该功能", icon: "none"}); } uni.navigateTo({url: modulePath}); + } else if (checkType == 4) { + if (!token) { + return dispatch('autoLogin').then(() => dispatch('authCheck', { checkType, modulePath })); + } + if (!userInfo.areaId) { + this.$dialog.confirm({ + content: '您只有完成信息认证后,才可进行相关操作。', + confirmText: '去认证' + }).then(() => { + uni.switchTab({ url: '/pages/AppMine/userInfo' }) + }).catch(() => { + }) + } } } } diff --git a/src/project/fengdu/AppHome/AppHome.vue b/src/project/fengdu/AppHome/AppHome.vue index 1706b9b..a0704eb 100644 --- a/src/project/fengdu/AppHome/AppHome.vue +++ b/src/project/fengdu/AppHome/AppHome.vue @@ -118,38 +118,27 @@ export default { }) }, handleClick({type, appId, modulePath, url, checkType, corpId}) { - if(this.user.areaId) { - //先判读是不是系统应用 - if (type != "0") { - if (type == "1") { - uni.navigateToMiniProgram({appId}); - } else if (type == "2") { - uni.navigateTo({url: "/subPages/h5/webview?link=" + url}); - } else if (type == "3") { - this.$linkTo(url); - } else if (type == "4") { - uni.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: corpId, - fail: () => { - this.$u.toast('请使用普通微信打开小程序进行咨询'); - } - }); - } - } else if (type && type == "0") { - uni.showLoading({title: '正在进入应用...'}) - this.authCheck({checkType, modulePath}).finally(() => uni.hideLoading()) + //先判读是不是系统应用 + if (type != "0") { + if (type == "1") { + uni.navigateToMiniProgram({appId}); + } else if (type == "2") { + uni.navigateTo({url: "/subPages/h5/webview?link=" + url}); + } else if (type == "3") { + this.$linkTo(url); + } else if (type == "4") { + uni.openCustomerServiceChat({ + extInfo: {url: url}, + corpId: corpId, + fail: () => { + this.$u.toast('请使用普通微信打开小程序进行咨询'); + } + }); } - } else { - this.$dialog.confirm({ - content: '您只有完成信息认证后,才可进行相关操作。', - confirmText: '去认证' - }).then(() => { - uni.switchTab({ url: '/pages/AppMine/userInfo' }) - }).catch(() => { - }) + } else if (type && type == "0") { + uni.showLoading({title: '正在进入应用...'}) + this.authCheck({checkType, modulePath}).finally(() => uni.hideLoading()) } - }, handleBannerClick(index) { if (!this.swiperList[index].linkUrl) return diff --git a/src/project/fengdu/AppMine/AppMine.vue b/src/project/fengdu/AppMine/AppMine.vue index 20eb269..0c6e9aa 100644 --- a/src/project/fengdu/AppMine/AppMine.vue +++ b/src/project/fengdu/AppMine/AppMine.vue @@ -161,7 +161,7 @@ export default { }, getAuth() { this.$nextTick(() => { - this.token && this.getUserInfo() + this.token && this.getUserInfo('qujing') }) }, onLogout() {