From 38712ae83223cb244020e255fc37e1ce35775c45 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 09 四月 2026 13:53:40 +0800
Subject: [PATCH] 优化
---
src/views/h5/verify/index.vue | 60 +++++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 39 insertions(+), 21 deletions(-)
diff --git a/src/views/h5/verify/index.vue b/src/views/h5/verify/index.vue
index 02e2d30..6c4bc70 100644
--- a/src/views/h5/verify/index.vue
+++ b/src/views/h5/verify/index.vue
@@ -2,33 +2,27 @@
<div></div>
</template>
<script>
-import { tokenUtils } from '@/utils/axios.js';
-
export default {
components: {},
data() {
return {}
},
computed: {
- query() {
- return this.$route.query
- },
appId() {
- return this.query.appId
+ return this.$route.query.appId
}
},
async created() {
const canVerify = await this.getCanVerify()
- if (canVerify) {
- if (!this.getIsFace()) {
- this.$router.replace({ path: '/h5/face', query: { appId: this.appId }})
- } else if (!this.getIsSignup()) {
- this.$router.replace({ path: '/h5/signup', query: { appId: this.appId } })
- } else {
- this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
- }
- } else {
+ if (!canVerify) {
this.$router.replace('/h5/noVerAccess')
+ return
+ }
+ const getCheckIsSubmit = await this.getCheckIsSubmit()
+ if (getCheckIsSubmit) {
+ this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }})
+ } else {
+ this.$router.replace({ path: '/h5/face', query: { appId: this.appId }})
}
},
mounted() {
@@ -38,7 +32,7 @@
getCanVerify() {
return new Promise((resolve) => {
const params = {
- applicationId: this.$route.query.appId
+ applicationId: this.appId
}
this.$axios.get('/exam/verify-record/can-verify', { params }).then(res => {
if (res.data.code == 0) {
@@ -51,12 +45,36 @@
})
})
},
- getIsFace() {
- return Boolean(localStorage.getItem('isFace'))
+ getCheckIsSubmit() {
+ return new Promise((resolve) => {
+ const params = { applicationId: this.appId }
+ this.$axios.get('/exam/verify-record/get-by-application-id', { params }).then(res => {
+ if (res.data.code == 0) {
+ resolve(res.data.data.isVerified)
+ } else {
+ resolve(false)
+ }
+ }, () => {
+ resolve(false)
+ })
+ })
},
- getIsSignup() {
- return Boolean(localStorage.getItem('isSignup'))
- }
+ getCheckinExist() {
+ return new Promise((resolve) => {
+ const params = {
+ targetId: this.appId
+ }
+ this.$axios.get('/exam/staff/checkin/exist', { params }).then(res => {
+ if (res.data.code == 0) {
+ resolve(res.data.data)
+ } else {
+ resolve(false)
+ }
+ }, () => {
+ resolve(false)
+ })
+ })
+ },
}
}
</script>
\ No newline at end of file
--
Gitblit v1.8.0