|
@@ -116,6 +116,7 @@ export default {
|
|
|
} catch (error) {
|
|
|
// FIXME: more processing
|
|
|
console.log("同步照片比对流程失败");
|
|
|
+ throw error;
|
|
|
} finally {
|
|
|
const video = this.$refs.video;
|
|
|
video && video.play();
|
|
@@ -124,8 +125,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async getSnapShot() {
|
|
|
- return new Promise(resolve => {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
const video = this.$refs.video;
|
|
|
+ if (video.readyState !== 4) {
|
|
|
+ this.$Message.error({ content: "摄像头没有正常启用", duration: 5 });
|
|
|
+ reject("摄像头没有正常启用");
|
|
|
+ this.logout();
|
|
|
+ return;
|
|
|
+ }
|
|
|
video.pause();
|
|
|
var canvas = document.createElement("canvas");
|
|
|
canvas.width = 220;
|