desc: 调整接口请求次数

This commit is contained in:
zyy 2019-09-04 19:06:55 +08:00
parent 0f9b0f84a5
commit 921ef7c03d
3 changed files with 5 additions and 7 deletions

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 获取题列表*/ /** 获取用户试题列表*/
export function generateExamList(examId) { export function generateExamList(examId) {
return request({ return request({
url: `/api/userExam/${examId}/generate`, url: `/api/userExam/${examId}/generate`,

View File

@ -153,7 +153,6 @@ class Jlmap {
const type = elem._type; const type = elem._type;
const oDevice = this.mapDevice[code] || deviceFactory(type, elem); const oDevice = this.mapDevice[code] || deviceFactory(type, elem);
const nDevice = Object.assign(oDevice || {}, elem); const nDevice = Object.assign(oDevice || {}, elem);
console.log(oDevice, nDevice, 111);
this.$painter.delete(oDevice); this.$painter.delete(oDevice);
if (!elem._dispose) { if (!elem._dispose) {
this.mapDevice[code] = nDevice; this.mapDevice[code] = nDevice;

View File

@ -146,9 +146,7 @@ export default {
} }
}); });
}); });
const resp = await generateExamList(this.examDetails.id);
this.examList = resp.data.userExamQuestionsVOs;
this.userExam = resp.data;
} }
}, },
buy() { buy() {
@ -168,6 +166,7 @@ export default {
const data = this.examDetails; const data = this.examDetails;
try { try {
const response = await generateExamList(data.id); const response = await generateExamList(data.id);
this.examList = response.data.userExamQuestionsVOs;
this.userExam = response.data; this.userExam = response.data;
const list = response.data.userExamQuestionsVOs; const list = response.data.userExamQuestionsVOs;
await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime); await this.$store.dispatch('exam/setUsedTime', this.userExam.usedTime);
@ -191,9 +190,9 @@ export default {
} }
} }
}, },
exmaStart() { async exmaStart() {
this.loading = true; this.loading = true;
this.examDetail(); await this.examDetail();
if (this.examList.length) { if (this.examList.length) {
examNotify({ examId: this.$route.params.examId }).then(resp => { examNotify({ examId: this.$route.params.examId }).then(resp => {
const query = { const query = {