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

修改bug

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