|
@@ -12,7 +12,6 @@
|
|
import { mapState as globalMapState } from "vuex";
|
|
import { mapState as globalMapState } from "vuex";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
import { createNamespacedHelpers } from "vuex";
|
|
const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
|
|
const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
|
|
-import { UPYUN_URL } from "../../constants/constants.js";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "FaceRecognition",
|
|
name: "FaceRecognition",
|
|
@@ -55,7 +54,6 @@ export default {
|
|
...mapMutations(["toggleSnapNow"]),
|
|
...mapMutations(["toggleSnapNow"]),
|
|
async openCamera() {
|
|
async openCamera() {
|
|
const video = this.$refs.video;
|
|
const video = this.$refs.video;
|
|
-
|
|
|
|
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
|
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
|
try {
|
|
try {
|
|
console.log("启动摄像头");
|
|
console.log("启动摄像头");
|
|
@@ -88,6 +86,8 @@ export default {
|
|
this.msg = "上传照片中...";
|
|
this.msg = "上传照片中...";
|
|
const [, captureFilePath] = await this.uploadToServer(captureBlob);
|
|
const [, captureFilePath] = await this.uploadToServer(captureBlob);
|
|
this.msg = "人脸比对中...";
|
|
this.msg = "人脸比对中...";
|
|
|
|
+ const UPYUN_URL = (await this.$http.get("/api/ecs_oe_student_face/upyun"))
|
|
|
|
+ .data.downloadPrefix;
|
|
await this.faceCompareSync(UPYUN_URL + captureFilePath);
|
|
await this.faceCompareSync(UPYUN_URL + captureFilePath);
|
|
const video = this.$refs.video;
|
|
const video = this.$refs.video;
|
|
video && video.play();
|
|
video && video.play();
|