校验登录信息和认证信息

This commit is contained in:
shijingjing
2023-03-31 13:47:48 +08:00
parent 1812afed13
commit bc2dae4a9b

View File

@@ -54,6 +54,7 @@
<div class="daka">{{ dkqd }}<span v-if="isClock==1">/积分+{{ intoIntegral }}</span></div> <div class="daka">{{ dkqd }}<span v-if="isClock==1">/积分+{{ intoIntegral }}</span></div>
</div> </div>
</div> </div>
<AiLogin ref="login" @success="getAuth()"/>
</div> </div>
</template> </template>
@@ -77,7 +78,7 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user', 'token']),
intoIntegral() { intoIntegral() {
const times = new Date().getTime() const times = new Date().getTime()
const inSTimes = new Date(this.info.intoBegintime?.replaceAll('-', '/')).getTime() const inSTimes = new Date(this.info.intoBegintime?.replaceAll('-', '/')).getTime()
@@ -336,6 +337,11 @@ export default {
} }
}) })
}, },
getAuth() {
this.$nextTick(() => {
this.token && this.getUserInfo('qujing')
})
}
}, },
onLoad(o) { onLoad(o) {
@@ -346,6 +352,9 @@ export default {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '任务详情' title: '任务详情'
}); });
if (!this.token) {
this.$refs.login.show()
}
if (!this.user.idNumber) { if (!this.user.idNumber) {
this.$dialog.confirm({ this.$dialog.confirm({
content: '您只有完成信息认证后,才可进行相关操作。', content: '您只有完成信息认证后,才可进行相关操作。',
@@ -356,6 +365,7 @@ export default {
}) })
} else { } else {
this.getDetail() this.getDetail()
this.showPages = true
} }
this.qqmapsdk = new QQMapWX({ this.qqmapsdk = new QQMapWX({
key: process.env.NODE_ENV == 'production' ? 'RWWBZ-64BEJ-MVLFJ-FTHLQ-JTR6J-SAB2S' : '3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY' key: process.env.NODE_ENV == 'production' ? 'RWWBZ-64BEJ-MVLFJ-FTHLQ-JTR6J-SAB2S' : '3RZBZ-LZUCF-CT6J5-NWKZH-FCWOQ-UUFKY'