| | |
| | | <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 checkinExist = await this.getCheckinExist() |
| | | if (checkinExist) { |
| | | this.$router.replace({ path: '/h5/verForm', query: { appId: this.appId }}) |
| | | } else { |
| | | this.$router.replace({ path: '/h5/face', query: { appId: this.appId }}) |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | 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) { |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | getIsFace() { |
| | | return Boolean(localStorage.getItem('isFace')) |
| | | 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) |
| | | }) |
| | | }) |
| | | }, |
| | | getIsSignup() { |
| | | return Boolean(localStorage.getItem('isSignup')) |
| | | } |
| | | } |
| | | } |
| | | </script> |