提交 bdbab561 authored 作者: lihuihui's avatar lihuihui

修改bug

上级 541a744b
module.exports = {
domain: 'dev.ezijing.com',
url: 'https://x-exam.ezijing.com/api',
url: 'https://x-exam2.ezijing.com/api',
isEnableToIphoneDebugger: false,
// apiBaseURL: '//demo-login.ezijing.com/',
webpack: {
......@@ -13,21 +13,21 @@ module.exports = {
devServer: {
proxy: {
/* 多个代理 */
// '/api': {
// target: $GLOBAL.webConf.url,
// selfHandleResponse: false,
// // selfHandleResponse: true, // 自定义 响应结构
// secure: false, // 如果是https接口,需要配置这个参数
// changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
// followRedirects: true, // 由于重定向307,所以跟随重定向直接返回一个接口
// logLevel: 'info', // 日志打印级别
// headers: {
// 'Referer': $GLOBAL.webConf.url
// },
// pathRewrite: {
// '^/api': '/' // 需要rewrite重写的
// }
// }
'/api/call/': {
target: 'https://test-microservice-x-exam-service-api.ezijing.com',
selfHandleResponse: false,
// selfHandleResponse: true, // 自定义 响应结构
secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
followRedirects: true, // 由于重定向307,所以跟随重定向直接返回一个接口
logLevel: 'info', // 日志打印级别
// headers: {
// 'Referer': $GLOBAL.webConf.url
// },
// pathRewrite: {
// '^/api': '/' // 需要rewrite重写的
// }
}
}
}
},
......
......@@ -8,6 +8,7 @@ export default class LoginAction extends BaseACTION {
userLogin (examId, obj) { return Login.userLogin(examId, obj).then(res => res) }
/* 确认信息 */
confirmInfo (examId, obj) { return Login.confirmInfo(examId, obj).then(res => res) }
sendExamInfo (obj) { return Login.sendExamInfo(obj).then(res => res) }
// /* post传输方式 */
// postTest (obj = {}) {
// return Login.postTest(obj).then(res => {
......
......@@ -20,4 +20,5 @@ export default class TestAPI extends BaseAPI {
// * 当前登录用户,检测是否该系统有权限
// */
// getInfo = () => this.post('/user_center/get_user_info', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
sendExamInfo = (obj = {}) => this.post('/call/v1/exam/student-status/commit', obj, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } })
}
......@@ -86,12 +86,20 @@ export default {
data() {
return {
questionData: {},
clearTime: null
clearTime: null,
setCacheTime: null
}
},
beforeDestroy() {
clearInterval(this.setCacheTime)
},
created() {
},
mounted() {
clearInterval(this.setCacheTime)
this.setCacheTime = setInterval(() => {
this.setCache()
}, 3000)
this.dataCombined()
},
methods: {
......@@ -268,7 +276,6 @@ export default {
watch: {
changeQuestionIndex(newV, oldV) {
this.dataCombined()
this.setCache()
this.signCallback()
this.$nextTick(() => {
this.createTag()
......
......@@ -97,6 +97,7 @@ export default {
}
},
mounted() {
this.sendExamInfo(3)
this.setTick()
this.getTopic()
this.countHeight()
......@@ -105,6 +106,17 @@ export default {
}
},
methods: {
sendExamInfo(status) {
const param = {
student_id: this.sInfo.info.student_id,
exam_id: this.examInfo.exam_id,
status: status
}
action.Login.sendExamInfo(param).then(res => {
}).catch(err => {
console.log(err)
})
},
countHeight() {
this.contentHeight = parseInt(document.body.clientHeight - (this.getDom('head-h').offsetHeight + this.getDom('foot-h').offsetHeight))
},
......@@ -170,6 +182,7 @@ export default {
return countNum
},
endExamRequest(n) {
this.sendExamInfo(5)
const param = {
answer: JSON.stringify(this.questionParams.answerRecord)
}
......@@ -180,6 +193,7 @@ export default {
path: '/examEnd'
})
}
this.sendExamInfo(6)
window.localStorage.setItem('showflag', 'true')
}).catch(err => {
if (err.message.indexOf('error') !== -1) {
......
......@@ -77,6 +77,17 @@ export default {
})
},
methods: {
sendExamInfo(studentId) {
const param = {
student_id: studentId,
exam_id: this.data.exam_id,
status: 2
}
action.Login.sendExamInfo(param).then(res => {
}).catch(err => {
console.log(err)
})
},
closePop() {
this.fullScreen()
this.isPopup = false
......@@ -145,6 +156,7 @@ export default {
action.Login.userLogin(this.data.exam_id, { examinee_number: this.examineeNumber }).then(res => {
window.localStorage.setItem('studentInfo', JSON.stringify(res))
const status = parseInt(res.sheet_status)
this.sendExamInfo(res.info.student_id)
if (status === 0) {
this.$router.replace({
name: 'confirmInfo'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论