竞赛平台代码调整
This commit is contained in:
parent
652e9aa5d7
commit
c502d755f9
@ -146,3 +146,12 @@ export function getRaceById(id) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 退出当前赛场 */
|
||||
export function quitCurrentRace(id, params) {
|
||||
return request({
|
||||
url: `/api/v1/competition/${id}/room`,
|
||||
method: 'delete',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
// import { commitExam, getExamInfo, getUserExam, saveExamAnswer } from '@/api/exam.js';
|
||||
// import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import Question from './question';
|
||||
import { postCompetitionTheory, getTheoryQuestion } from '@/api/competition';
|
||||
import { postCompetitionTheory, getTheoryQuestion, quitCurrentRace } from '@/api/competition';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -86,6 +86,10 @@ export default {
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
beforeDestroy() {
|
||||
quitCurrentRace(this.$route.query.raceId, {}).then(res=>{
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.theoryAnswers = [];
|
||||
|
@ -34,7 +34,7 @@ import { putJointTrainingSimulationUserNew} from '@/api/jointTraining';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import RealDevice from './menuDraft/realDevice';
|
||||
import { participantCompleteCompetition, refereeExitSimulation } from '@/api/competition';
|
||||
import { participantCompleteCompetition, refereeExitSimulation, quitCurrentRace } from '@/api/competition';
|
||||
import { prefixIntrger } from '@/utils/date';
|
||||
|
||||
export default {
|
||||
@ -146,6 +146,10 @@ export default {
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$store.dispatch('training/setGroup', '');
|
||||
if (this.project === 'jsxt') {
|
||||
quitCurrentRace(this.$route.query.raceId, {group:this.group}).then(res=>{
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async initLoadPage() {
|
||||
|
Loading…
Reference in New Issue
Block a user