From e2b1687be8795b1b4d0cf92e24ad1b43d4b4cab9 Mon Sep 17 00:00:00 2001 From: "luoJunYong.123" Date: Tue, 7 Dec 2021 10:48:21 +0800 Subject: [PATCH] youhua --- src/api/http.js | 2 +- src/components/case/index.vue | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/api/http.js b/src/api/http.js index 9a52b7f..2f8b0e8 100644 --- a/src/api/http.js +++ b/src/api/http.js @@ -29,7 +29,7 @@ export const deleteCache= () => { } // 学生查看考核状态 export const checkTest= (params) => { - return get( '/occupationlab/assessment/getDetailById') + return get( '/occupationlab/assessment/getDetailById', {...params}) } export const checkTest2= (params) => { return post( '/occupationlab/assessment/pageStuAssessment',{ diff --git a/src/components/case/index.vue b/src/components/case/index.vue index eee7b7c..c09487d 100644 --- a/src/components/case/index.vue +++ b/src/components/case/index.vue @@ -186,21 +186,19 @@ export default { timestamp:'', } }, - async created() { - // const test = await checkTest('/occupationlab/assessment/getDetailById', { - // id: 91 - // }) - // console.log(test) - // // const test = await checkTest() - // console.log('test') + created() { const { query: { token, assessmentId } } = this.$route sessionStorage.setItem('assessmentId', assessmentId) + sessionStorage.setItem('token', token) this.intervalJudge = setInterval(() => { - checkTest2({ assessmentId: parseInt(sessionStorage.getItem('assessmentId')) }).then(t => { - const { data: { list } } = t - console.log(list) - const aimItem = list.find(item => item.assessmentId == parseInt(sessionStorage.getItem('assessmentId'))) - if(aimItem.status !== 1) { + const data = { + id: parseInt(sessionStorage.getItem('assessmentId')), + token: parseInt(sessionStorage.getItem('token')) + } + checkTest(data).then(data => { + console.log(data) + const { data: { data: { status } } } = data + if(status !== 1) { this.popContainer = true clearInterval(this.intervalJudge) this.$message({