|
@@ -200,11 +200,12 @@ export default {
|
|
|
this.logger({
|
|
|
action: "摄像头没有正常启用",
|
|
|
detail: error,
|
|
|
- errorName: error.name,
|
|
|
- errorMessage: error.message,
|
|
|
- errorStringify: JSON.stringify(error, (key, value) =>
|
|
|
+ errorJSON: JSON.stringify(error, (key, value) =>
|
|
|
key === "token" ? "" : value
|
|
|
),
|
|
|
+ errorName: error.name,
|
|
|
+ errorMessage: error.message,
|
|
|
+ errorStack: error.stack,
|
|
|
});
|
|
|
this.$Message.error({
|
|
|
content: "摄像头没有正常启用: " + error,
|
|
@@ -288,7 +289,12 @@ export default {
|
|
|
this.logger({
|
|
|
action: "摄像头打开失败",
|
|
|
detail: "无法启用摄像头",
|
|
|
- error: errorMsgLog,
|
|
|
+ errorJSON: JSON.stringify(error, (key, value) =>
|
|
|
+ key === "token" ? "" : value
|
|
|
+ ),
|
|
|
+ errorName: error.name,
|
|
|
+ errorMessage: error.message,
|
|
|
+ errorStack: error.stack,
|
|
|
// getSupportedConstraints:
|
|
|
// navigator.mediaDevices.getSupportedConstraints &&
|
|
|
// navigator.mediaDevices.getSupportedConstraints(),
|
|
@@ -365,9 +371,12 @@ export default {
|
|
|
console.log("定时抓拍流程失败", error);
|
|
|
this.logger({
|
|
|
action: "定时抓拍流程失败",
|
|
|
- detail: JSON.stringify(error, (key, value) =>
|
|
|
+ errorJSON: JSON.stringify(error, (key, value) =>
|
|
|
key === "token" ? "" : value
|
|
|
),
|
|
|
+ errorName: error.name,
|
|
|
+ errorMessage: error.message,
|
|
|
+ errorStack: error.stack,
|
|
|
});
|
|
|
window._hmt.push([
|
|
|
"_trackEvent",
|
|
@@ -404,6 +413,12 @@ export default {
|
|
|
// console.log(v);
|
|
|
// return;
|
|
|
|
|
|
+ this.logger({
|
|
|
+ page: "同步人脸比对",
|
|
|
+ button: "开始识别按钮",
|
|
|
+ action: "点击",
|
|
|
+ });
|
|
|
+
|
|
|
this.$Message.destroy();
|
|
|
try {
|
|
|
this.disableSnap = true;
|
|
@@ -531,6 +546,8 @@ export default {
|
|
|
}
|
|
|
// console.log(fileMd5);
|
|
|
// console.log(fileMd5, fileMd5Base64);
|
|
|
+ this.__duplicateMD5 = window.__previousPhotoMD5 === fileMd5Base64;
|
|
|
+ window.__previousPhotoMD5 = fileMd5Base64;
|
|
|
|
|
|
const params = new URLSearchParams();
|
|
|
params.append("fileSuffix", "png");
|
|
@@ -587,9 +604,12 @@ export default {
|
|
|
this.logger({
|
|
|
page: "摄像头框",
|
|
|
detail: "抓拍照片保存失败",
|
|
|
- error: JSON.stringify(error, (key, value) =>
|
|
|
+ errorJSON: JSON.stringify(error, (key, value) =>
|
|
|
key === "token" ? "" : value
|
|
|
),
|
|
|
+ errorName: error.name,
|
|
|
+ errorMessage: error.message,
|
|
|
+ errorStack: error.stack,
|
|
|
});
|
|
|
window._hmt.push([
|
|
|
"_trackEvent",
|
|
@@ -617,9 +637,12 @@ export default {
|
|
|
this.logger({
|
|
|
page: "摄像头框",
|
|
|
detail: "保存抓拍照片到服务器失败!",
|
|
|
- error: JSON.stringify(e, (key, value) =>
|
|
|
+ errorJSON: JSON.stringify(e, (key, value) =>
|
|
|
key === "token" ? "" : value
|
|
|
),
|
|
|
+ errorName: e.name,
|
|
|
+ errorMessage: e.message,
|
|
|
+ errorStack: e.stack,
|
|
|
});
|
|
|
window._hmt.push([
|
|
|
"_trackEvent",
|
|
@@ -646,12 +669,20 @@ export default {
|
|
|
},
|
|
|
async faceCompareSync(captureFilePath, signIdentifier) {
|
|
|
try {
|
|
|
+ this.logger({
|
|
|
+ page: "摄像头框",
|
|
|
+ action: "同步比对开始",
|
|
|
+ });
|
|
|
const res = await this.$http.post(
|
|
|
"/api/ecs_oe_student_face/examCaptureQueue/compareFaceSync?signIdentifier=" +
|
|
|
signIdentifier +
|
|
|
"&fileUrl=" +
|
|
|
encodeURIComponent(captureFilePath)
|
|
|
);
|
|
|
+ this.logger({
|
|
|
+ page: "摄像头框",
|
|
|
+ action: "同步比对成功",
|
|
|
+ });
|
|
|
|
|
|
this.$emit("on-recognize-result", {
|
|
|
error: null,
|
|
@@ -661,6 +692,16 @@ export default {
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
|
// this.$Message.error(e.message);
|
|
|
+ this.logger({
|
|
|
+ page: "摄像头框",
|
|
|
+ action: "同步比对失败",
|
|
|
+ errorJSON: JSON.stringify(e, (key, value) =>
|
|
|
+ key === "token" ? "" : value
|
|
|
+ ),
|
|
|
+ errorName: e.name,
|
|
|
+ errorMessage: e.message,
|
|
|
+ errorStack: e.stack,
|
|
|
+ });
|
|
|
throw new Error("同步照片比较失败!");
|
|
|
}
|
|
|
},
|
|
@@ -676,6 +717,8 @@ export default {
|
|
|
window.nodeRequire("node-cmd").get("multiCamera.exe", () => {
|
|
|
try {
|
|
|
cameraInfos = fs.readFileSync("CameraInfo.txt", "utf-8");
|
|
|
+ // cameraInfos =
|
|
|
+ // '[{"detail":"@device:pnp:?display#int3470#4&300121c4&0&uid13424#{65e8773d-8f56-11d0-a3b9-00a0c9223196}{9c5f415a-02cd-4e28-aeb7-811cb317dd64}","name":"HP Truevision 5MP Front","pid":"13424","vid":"3470"},{"detail":"@device:pnp:?display#int3470#4&300121c4&0&uid13424#{65e8773d-8f56-11d0-a3b9-00a0c9223196}{a6c1c503-01f1-4767-a229-00a0b223162f}","name":"HP Truevision 8MP Rear","pid":"13424","vid":"3470"},{"detail":"@device:pnp:?usb#vid_8086&pid_0a80&mi_04#6&28913c47&0&0004#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global","name":"Intel(R) RealSense(TM) 3D Camera (R200) RGB","pid":"0a80","vid":"8086"},{"detail":"@device:pnp:?usb#vid_8086&pid_0a80&mi_00#6&28913c47&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global","name":"Intel(R) RealSense(TM) 3D Camera (R200) Left-Right","pid":"0a80","vid":"8086"},{"detail":"@device:pnp:?usb#vid_8086&pid_0a80&mi_02#6&28913c47&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}global","name":"Intel(R) RealSense(TM) 3D Camera (R200) Depth","pid":"0a80","vid":"8086"}]';
|
|
|
if (cameraInfos && cameraInfos.trim()) {
|
|
|
cameraInfos = cameraInfos.trim();
|
|
|
cameraInfos = cameraInfos.replace(/\r\n/g, "");
|
|
@@ -695,14 +738,59 @@ export default {
|
|
|
JSON.parse(cameraInfos).cameraInfo
|
|
|
);
|
|
|
}
|
|
|
+ if (cameraInfos.length >= 800) {
|
|
|
+ this.logger({
|
|
|
+ page: "摄像头框",
|
|
|
+ type: "虚拟摄像头-cameraInfos超长",
|
|
|
+ cameraInfos: cameraInfos,
|
|
|
+ });
|
|
|
+ let ary = JSON.parse(cameraInfos);
|
|
|
+ // 相同pid&vid仅保留一个
|
|
|
+ const pidAndVidCollector = [];
|
|
|
+ ary = ary.filter((c) => {
|
|
|
+ const pv = c.pid + "|" + c.vid;
|
|
|
+ const res = pidAndVidCollector.includes(pv);
|
|
|
+ pidAndVidCollector.push(pv);
|
|
|
+ return !res;
|
|
|
+ });
|
|
|
+ cameraInfos = JSON.stringify(ary);
|
|
|
+ console.log("摄像头检测超长:", "去除重复pid&vid");
|
|
|
+ console.log(cameraInfos);
|
|
|
+ if (cameraInfos.length >= 800) {
|
|
|
+ cameraInfos = JSON.stringify(
|
|
|
+ JSON.parse(cameraInfos).map((v) => {
|
|
|
+ return {
|
|
|
+ pid: v.pid,
|
|
|
+ vid: v.pid,
|
|
|
+ detail: "omitted",
|
|
|
+ name: v.name,
|
|
|
+ };
|
|
|
+ })
|
|
|
+ );
|
|
|
+ console.log("摄像头检测超长:", "去除detail");
|
|
|
+ console.log(cameraInfos);
|
|
|
+ }
|
|
|
+ if (cameraInfos.length >= 800) {
|
|
|
+ console.log("摄像头检测超长:", "精简后还是超长");
|
|
|
+ this.logger({
|
|
|
+ page: "摄像头框",
|
|
|
+ type: "虚拟摄像头-精简后还是超长",
|
|
|
+ cameraInfos: cameraInfos,
|
|
|
+ });
|
|
|
+ console.log(cameraInfos);
|
|
|
+ }
|
|
|
+ }
|
|
|
resolve();
|
|
|
} catch (error) {
|
|
|
this.logger({
|
|
|
page: "摄像头框",
|
|
|
type: "虚拟摄像头-读取摄像头列表失败",
|
|
|
- error: JSON.stringify(error, (key, value) =>
|
|
|
+ errorJSON: JSON.stringify(error, (key, value) =>
|
|
|
key === "token" ? "" : value
|
|
|
),
|
|
|
+ errorName: error.name,
|
|
|
+ errorMessage: error.message,
|
|
|
+ errorStack: error.stack,
|
|
|
});
|
|
|
window._hmt.push([
|
|
|
"_trackEvent",
|
|
@@ -736,6 +824,7 @@ export default {
|
|
|
examRecordDataId,
|
|
|
cameraInfos,
|
|
|
hasVirtualCamera,
|
|
|
+ duplicateMD5: this.__duplicateMD5,
|
|
|
});
|
|
|
}
|
|
|
const res = await this.$http.post(
|
|
@@ -749,9 +838,12 @@ export default {
|
|
|
this.logger({
|
|
|
page: "摄像头框",
|
|
|
action: "设置获取抓拍结果失败!",
|
|
|
- error: JSON.stringify(error, (key, value) =>
|
|
|
+ errorJSON: JSON.stringify(error, (key, value) =>
|
|
|
key === "token" ? "" : value
|
|
|
),
|
|
|
+ errorName: error.name,
|
|
|
+ errorMessage: error.message,
|
|
|
+ errorStack: error.stack,
|
|
|
});
|
|
|
this.$Message.error({
|
|
|
content: "设置获取抓拍结果失败!",
|