提交 3288b36c authored 作者: lihuihui's avatar lihuihui

updata

上级 0bc47b6f
...@@ -210,6 +210,7 @@ export default { ...@@ -210,6 +210,7 @@ export default {
this.examTime = `${h} : ${m} : ${s} 倒计时` this.examTime = `${h} : ${m} : ${s} 倒计时`
}, },
setTick() { setTick() {
let flag = true
this.clearTime = setInterval(() => { this.clearTime = setInterval(() => {
const nowtime = new Date() const nowtime = new Date()
const endtime = new Date(this.examInfo.end_time) const endtime = new Date(this.examInfo.end_time)
...@@ -221,7 +222,12 @@ export default { ...@@ -221,7 +222,12 @@ export default {
} else { } else {
this.countDown(countTime) this.countDown(countTime)
} }
countTime === 2 && (this.endExam(1)) if (flag) {
parseInt(countTime) <= 2 && (() => {
this.endExam(1)
flag = false
})()
}
}, 1000) }, 1000)
}, },
addZero(i) { addZero(i) {
......
...@@ -199,9 +199,20 @@ export default { ...@@ -199,9 +199,20 @@ export default {
window.localStorage.setItem('studentInfo', JSON.stringify(res)) window.localStorage.setItem('studentInfo', JSON.stringify(res))
} }
}).catch(err => { }).catch(err => {
this.$alert(err.message, { if (parseInt(err.status) === 403) {
callback: action => {} this.$alert(err.message, {
}) callback: action => {
this.$router.replace({
path: `/login/${JSON.parse(window.localStorage.getItem('examInfo')).exam_id}`
})
}
})
} else {
this.$alert(err.message, {
callback: action => {
}
})
}
}) })
} }
}, },
...@@ -227,7 +238,7 @@ export default { ...@@ -227,7 +238,7 @@ export default {
} }
if (this.allForm[i].key === 'email') { if (this.allForm[i].key === 'email') {
if (!(/^([a-zA-Z\d])(\w)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/.test(this.form.email))) { if (!(/^([a-zA-Z\d])(\w)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/.test(this.form.email))) {
this.$alert('手机号格式不正确') this.$alert('邮箱格式不正确')
return false return false
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论