|
|
|
@ -355,16 +355,34 @@ export default { |
|
|
|
|
initState: 'system/initState' |
|
|
|
|
}), |
|
|
|
|
clearStore() { |
|
|
|
|
// 清空缓存 |
|
|
|
|
// // 清空缓存 |
|
|
|
|
let token = sessionStorage.getItem('token') |
|
|
|
|
let cid = sessionStorage.getItem('cid') |
|
|
|
|
let systemId = sessionStorage.getItem('systemId') |
|
|
|
|
let projectId = sessionStorage.getItem('projectId') |
|
|
|
|
let assessmentId = sessionStorage.getItem('assessmentId') |
|
|
|
|
let classId = sessionStorage.getItem('classId') |
|
|
|
|
let timestamp = sessionStorage.getItem('timestamp') |
|
|
|
|
let startTime = sessionStorage.getItem('startTime') |
|
|
|
|
sessionStorage.clear() |
|
|
|
|
sessionStorage.setItem('token', token) |
|
|
|
|
sessionStorage.setItem('cid', cid) |
|
|
|
|
sessionStorage.setItem('systemId', systemId) |
|
|
|
|
sessionStorage.setItem('projectId', projectId) |
|
|
|
|
if(assessmentId) { |
|
|
|
|
sessionStorage.setItem('assessmentId', assessmentId) |
|
|
|
|
} |
|
|
|
|
if(classId) { |
|
|
|
|
sessionStorage.setItem('classId', classId) |
|
|
|
|
} |
|
|
|
|
if(timestamp) { |
|
|
|
|
sessionStorage.setItem('timestamp', timestamp) |
|
|
|
|
} |
|
|
|
|
if(startTime) { |
|
|
|
|
sessionStorage.setItem('startTime', startTime) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 初始化vuex中的state |
|
|
|
|
this.initState(); |
|
|
|
|
}, |
|
|
|
@ -406,30 +424,30 @@ export default { |
|
|
|
|
this.topicList.push(data.data.projects[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// if(this.topicList.length > 0){ |
|
|
|
|
// // const projectIndex = JSON.parse(sessionStorage.getItem('projectIndex')) |
|
|
|
|
// // const projectId = sessionStorage.getItem('projectId') |
|
|
|
|
// // console.log('---projectId') |
|
|
|
|
// // console.log(projectId) |
|
|
|
|
// // if(!projectId) { |
|
|
|
|
// // this.selectProjects({ |
|
|
|
|
// // projectId: this.topicList[0].projectId |
|
|
|
|
// // }) |
|
|
|
|
// // // localStorage.setItem('projectId') |
|
|
|
|
// // }else { |
|
|
|
|
// // this.selectProjects({ |
|
|
|
|
// // projectId: projectId |
|
|
|
|
// // }) |
|
|
|
|
// // } |
|
|
|
|
|
|
|
|
|
if(this.topicList.length > 0){ |
|
|
|
|
// const projectIndex = JSON.parse(sessionStorage.getItem('projectIndex')) |
|
|
|
|
// const projectId = sessionStorage.getItem('projectId') |
|
|
|
|
// console.log('---projectId') |
|
|
|
|
// console.log(projectId) |
|
|
|
|
// if(!projectId) { |
|
|
|
|
// this.selectProjects({ |
|
|
|
|
// projectId: this.topicList[0].projectId |
|
|
|
|
// }) |
|
|
|
|
// // localStorage.setItem('projectId') |
|
|
|
|
// }else { |
|
|
|
|
// this.selectProjects({ |
|
|
|
|
// projectId: projectId |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
this.selectProjects({ |
|
|
|
|
projectId: this.topicList[0].projectId |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// this.gotuQueryVariable() |
|
|
|
|
// // 加的 |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
this.gotuQueryVariable() |
|
|
|
|
// 加的 |
|
|
|
|
} |
|
|
|
|
this.getQueryCaches() |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
@ -535,6 +553,8 @@ export default { |
|
|
|
|
}, |
|
|
|
|
//选择好题目 |
|
|
|
|
selectProject(){ |
|
|
|
|
this.lockIt = false |
|
|
|
|
this.$router.push('/index/list') |
|
|
|
|
// 和重新开始区别开,不再问是否再试一次 |
|
|
|
|
// this.lockIt = false |
|
|
|
|
// let token = sessionStorage.getItem('token') |
|
|
|
@ -548,12 +568,16 @@ export default { |
|
|
|
|
// sessionStorage.setItem('projectId', projectId) |
|
|
|
|
// this.topicList[localProjectIndex].projectId |
|
|
|
|
// localStorage.setItem('localProjectIndex', JSON.stringify(this.projectId)) |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.clearStore() |
|
|
|
|
deleteCache().then((data)=>{ |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
// deleteCache().then((data)=>{ |
|
|
|
|
|
|
|
|
|
// }).catch(() => { |
|
|
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
let params = { |
|
|
|
|
"projectId":this.projectId, |
|
|
|
|