diff --git a/src/router/index.js b/src/router/index.js index 6d5b065..8072d6b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,11 +19,11 @@ const router = createRouter({ { path: '/exam', component: Exam - }, + }, { path:'/examDetail', - component: ExamDetail - } + component: ExamDetail, + } ], // 路由滚动行为定制 scrollBehavior() { diff --git a/src/utils/http.js b/src/utils/http.js index d20cea9..18b72e1 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -28,4 +28,4 @@ http.interceptors.response.use(res => { return Promise.reject(e) }) -export default http \ No newline at end of file +export default http diff --git a/src/views/Exam/index.vue b/src/views/Exam/index.vue index d7d56f3..02e6aa4 100644 --- a/src/views/Exam/index.vue +++ b/src/views/Exam/index.vue @@ -136,7 +136,7 @@ function handleAnswer(index) { currentQuestion.value = questionList.value[questionNum.value] } -function handleChange(e) { +function handleChange() { setTimeout(() => { next() }, 500) @@ -159,7 +159,12 @@ async function submit() { message: '提交成功', type: 'success' }) - router.replace({ path: '/' }) + + if (res.data) { + router.push({ path: '/examDetail', query: { data: JSON.stringify(res.data) } }) + } else { + router.replace({ path: '/' }) + } } } @@ -264,4 +269,4 @@ async function submit() { } } } - \ No newline at end of file + diff --git a/src/views/ExamDetail/index.vue b/src/views/ExamDetail/index.vue index 368eb70..e1b36dc 100644 --- a/src/views/ExamDetail/index.vue +++ b/src/views/ExamDetail/index.vue @@ -12,8 +12,9 @@ - - + + {{ item.evalPropose }} @@ -28,45 +29,49 @@ \ No newline at end of file + diff --git a/src/views/Login/index.vue b/src/views/Login/index.vue index 42bb037..ccb941d 100644 --- a/src/views/Login/index.vue +++ b/src/views/Login/index.vue @@ -15,7 +15,7 @@ @keyup.enter="login" /> - 登录 + 登录 @@ -23,7 +23,7 @@