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

updata

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