|
@@ -43,17 +43,13 @@ export default {
|
|
|
data() {
|
|
|
return { showFaceId: false, faceEnable: false };
|
|
|
},
|
|
|
- created() {
|
|
|
- this.initData();
|
|
|
- if (!this.$route.params.order) {
|
|
|
- // created can access this.$route?
|
|
|
- this.$router.push(this.$route.fullPath + "/order/1");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- this.toggleSnapNow();
|
|
|
- }, 5 * 1000); // 5秒钟后抓拍
|
|
|
+ async created() {
|
|
|
+ // if (!this.$route.params.order) {
|
|
|
+ // // created can access this.$route?
|
|
|
+ // this.$router.push(this.$route.fullPath + "/order/1");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ await this.initData();
|
|
|
|
|
|
// 仅在线上使用活体检测
|
|
|
if (
|
|
@@ -76,40 +72,30 @@ export default {
|
|
|
// // }, this.$route.query.faceVerifyMinute * 60 * 1000); // 定时做活体检测
|
|
|
// }, 5 * 1000); // 定时做活体检测
|
|
|
|
|
|
- this.$http
|
|
|
- .get(
|
|
|
- "/api/ecs_exam_work/exam/examOrgProperty/" +
|
|
|
- this.$route.params.examId +
|
|
|
- `/IS_FACE_ENABLE`
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- // console.log(res);
|
|
|
- if (res.data) {
|
|
|
- this.faceEnable = true;
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(reason => {
|
|
|
- this.$Message.error(reason);
|
|
|
- });
|
|
|
+ const faceEnable = await this.$http.get(
|
|
|
+ "/api/ecs_exam_work/exam/examOrgProperty/" +
|
|
|
+ this.$route.params.examId +
|
|
|
+ `/IS_FACE_ENABLE`
|
|
|
+ );
|
|
|
+ if (faceEnable.data) {
|
|
|
+ this.faceEnable = true;
|
|
|
|
|
|
- this.$http
|
|
|
- .get(
|
|
|
+ setTimeout(() => {
|
|
|
+ this.toggleSnapNow(); // 开启抓拍才在进入考试时抓拍一张
|
|
|
+ }, 1 * 1000); // 5秒钟后抓拍
|
|
|
+
|
|
|
+ const snapshotInterval = this.$http.get(
|
|
|
"/api/ecs_exam_work/exam/examOrgProperty/" +
|
|
|
this.$route.params.examId +
|
|
|
`/SNAPSHOT_INTERVAL`
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- // console.log(res);
|
|
|
- if (res.data) {
|
|
|
- // 考务设置抓拍间隔
|
|
|
- this.snapInterval = setInterval(() => {
|
|
|
- this.toggleSnapNow();
|
|
|
- }, res.data * 60 * 1000);
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(reason => {
|
|
|
- this.$Message.error(reason);
|
|
|
- });
|
|
|
+ );
|
|
|
+ if (snapshotInterval.data) {
|
|
|
+ // 考务设置抓拍间隔
|
|
|
+ this.snapInterval = setInterval(() => {
|
|
|
+ this.toggleSnapNow();
|
|
|
+ }, snapshotInterval.data * 60 * 1000);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
this.submitInterval = setInterval(
|
|
|
() => this.answerAllQuestions(),
|
|
@@ -267,7 +253,9 @@ export default {
|
|
|
return <div style="font-size: 50px">正在交卷,请耐心等待...</div>;
|
|
|
}
|
|
|
});
|
|
|
- this.toggleSnapNow();
|
|
|
+ if (this.faceEnable) {
|
|
|
+ this.toggleSnapNow();
|
|
|
+ }
|
|
|
// 确保抓拍指令在交卷前执行
|
|
|
setTimeout(() => this.realSubmitPaperStep2(), 1000);
|
|
|
},
|