|
@@ -637,7 +637,6 @@ import PulseLoader from "vue-spinner/src/PulseLoader.vue";
|
|
|
import {
|
|
|
openWS,
|
|
|
closeWsWithoutReconnect,
|
|
|
- getQRCode,
|
|
|
} from "@/features/OnlineExam/Examing/ws";
|
|
|
import { createNamespacedHelpers } from "vuex";
|
|
|
const { mapState } = createNamespacedHelpers("examingHomeModule");
|
|
@@ -735,14 +734,14 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
watch: {
|
|
|
- questionQrCode(value) {
|
|
|
- // console.log(this.examQuestion.studentAnswer);
|
|
|
- // console.log("watch", value);
|
|
|
- this.wechat.qrValue = value.qrCode;
|
|
|
- this.wechat.examRecordDataId = decodeURIComponent(value.qrCode).match(
|
|
|
- /&examRecordDataId=(\d+)&/
|
|
|
- )[1];
|
|
|
- },
|
|
|
+ // questionQrCode(value) {
|
|
|
+ // // console.log(this.examQuestion.studentAnswer);
|
|
|
+ // // console.log("watch", value);
|
|
|
+ // this.wechat.qrValue = value.qrCode;
|
|
|
+ // this.wechat.examRecordDataId = decodeURIComponent(value.qrCode).match(
|
|
|
+ // /&examRecordDataId=(\d+)&/
|
|
|
+ // )[1];
|
|
|
+ // },
|
|
|
questionQrCodeScanned() {
|
|
|
// console.log(this.examQuestion.studentAnswer);
|
|
|
// console.log("watch", value);
|
|
@@ -794,10 +793,24 @@ export default {
|
|
|
this.getNowInterval = setInterval(() => {
|
|
|
this.nowDate = Date.now();
|
|
|
}, 1000);
|
|
|
- openWS({ examRecordDataId: this.$store.state.user.id });
|
|
|
- if (!getQRCode(1, "AUDIO", { testEnv: true })) {
|
|
|
+ openWS({});
|
|
|
+ const fetchQR = async () => {
|
|
|
+ const examRecordDataId = this.$store.state.user.id;
|
|
|
+ const response = await this.$http.post(
|
|
|
+ "/api/ecs_oe_student/examControl/getQrCode",
|
|
|
+ {
|
|
|
+ examRecordDataId,
|
|
|
+ order: 1,
|
|
|
+ transferFileType: "AUDIO",
|
|
|
+ testEnv: true,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ this.wechat.qrValue = response.data;
|
|
|
+ this.wechat.examRecordDataId = examRecordDataId;
|
|
|
+ };
|
|
|
+ if (this.wechat.qrValue) {
|
|
|
this.getQRCodeTimeout = setTimeout(() => {
|
|
|
- getQRCode(1, "AUDIO", { testEnv: true });
|
|
|
+ fetchQR();
|
|
|
}, 3000);
|
|
|
}
|
|
|
},
|