This commit is contained in:
yanran200730
2023-03-20 16:55:19 +08:00
3 changed files with 34 additions and 31 deletions

View File

@@ -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(() => {
})
}
}
}
}

View File

@@ -118,7 +118,6 @@ export default {
})
},
handleClick({type, appId, modulePath, url, checkType, corpId}) {
if(this.user.areaId) {
//先判读是不是系统应用
if (type != "0") {
if (type == "1") {
@@ -140,16 +139,6 @@ export default {
uni.showLoading({title: '正在进入应用...'})
this.authCheck({checkType, modulePath}).finally(() => uni.hideLoading())
}
} else {
this.$dialog.confirm({
content: '您只有完成信息认证后,才可进行相关操作。',
confirmText: '去认证'
}).then(() => {
uni.switchTab({ url: '/pages/AppMine/userInfo' })
}).catch(() => {
})
}
},
handleBannerClick(index) {
if (!this.swiperList[index].linkUrl) return

View File

@@ -161,7 +161,7 @@ export default {
},
getAuth() {
this.$nextTick(() => {
this.token && this.getUserInfo()
this.token && this.getUserInfo('qujing')
})
},
onLogout() {