|
@@ -40,7 +40,8 @@ export default {
|
|
|
return { userPhoto: null, closeCamera: false };
|
|
|
},
|
|
|
props: {
|
|
|
- open: Boolean
|
|
|
+ open: Boolean,
|
|
|
+ course: Object
|
|
|
},
|
|
|
async created() {
|
|
|
const res = await this.$http.get(
|
|
@@ -59,6 +60,16 @@ export default {
|
|
|
"https://ecs-test-static.qmth.com.cn/student_base_photo/" +
|
|
|
this.userPhoto;
|
|
|
}
|
|
|
+
|
|
|
+ const sysRes = await this.$http.get("/api/sys_param", {
|
|
|
+ params: {
|
|
|
+ orgId: this.$store.state.user.rootOrgId
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // FIXME: 将faceEnable和faceCheck放到global的state中
|
|
|
+ this.faceEnable = sysRes.data.faceEnable; // 模拟练习?
|
|
|
+ this.faceCheck = sysRes.data.faceCheck; // 考试
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(["faceCheckModalOpen"])
|
|
@@ -70,14 +81,24 @@ export default {
|
|
|
this.toggleFaceCheckModal(false);
|
|
|
},
|
|
|
updateCameraState(modalVisible) {
|
|
|
- console.log(modalVisible);
|
|
|
this.closeCamera = !modalVisible;
|
|
|
},
|
|
|
- getFaceRecognitionResult(err, result) {
|
|
|
- console.log(err);
|
|
|
- if (!err) {
|
|
|
- const { faceCount, verifyResult, fileName } = result;
|
|
|
+ getFaceRecognitionResult({ error, faceCount, pass }) {
|
|
|
+ if (error) {
|
|
|
+ console.log(error, faceCount, pass);
|
|
|
+ this.$Message.error(error);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (!pass && this.course.faceCheck) {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: "郑重承诺",
|
|
|
+ content:
|
|
|
+ "我承诺由本人参加考试,并且同意接受考试监控系统信息审核,一经发现作弊,立即取消本门课程考试成绩。",
|
|
|
+ onOk: () => this.$router.push("/online-practice")
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.$router.push("/online-practice");
|
|
|
}
|
|
|
},
|
|
|
components: {
|