1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
| <template>
| <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
| }
| },
| async created() {
| if (tokenUtils.getAccessToken()) {
| const canVerify = await this.getCanVerify()
| if (canVerify) {
| this.$router.replace(`/h5/verForm/${this.appId}`)
| }
| // else {
| // this.$router.replace('/h5/noVerAccess')
| // }
| } else {
| this.$message.error('请先登录')
| this.$router.replace({ path: '/h5/login', query: { appId: this.appId } })
| }
| },
| mounted() {
| document.title = '考点核验'
| },
| methods: {
| getCanVerify() {
| return new Promise((resolve) => {
| const params = {
| applicationId: this.$route.query.appId
| }
| this.$axios.get('/exam/verify-record/can-verify', { params }).then(res => {
| if (res.data.code == 0) {
| resolve(res.data.data)
| } else {
| resolve(false)
| }
| }, () => {
| resolve(false)
| })
| })
| },
| }
| }
| </script>
|
|