zengyicheng 3 anni fa
parent
commit
3e413be32c
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/components/function.vue

+ 2 - 2
src/components/function.vue

@@ -157,7 +157,7 @@ export default {
           // 实时拍照效果
           _this.$refs["video"].play();
 
-          if (_this.$store.state.function.indexOf("face=1;") != -1 && _this.$store.state.function.indexOf("police=1;") != -1) {
+          if (_this.$store.state.function.indexOf("face=1;") != -1) {
             // this.$message.error("摄像头开启失败,请检查摄像头是否可用!");
 
             const video = this.videoEl;
@@ -186,7 +186,7 @@ export default {
                 _this.count += 1;
                 if (_this.count > 10) {
                   _this.isdetected = "已检测到人脸";
-                  if (_this.sampleArr.length > 0) {
+                  if (_this.sampleArr.length > 0 && _this.$store.state.function.indexOf("police=1;") != -1) {
                     _this.fnRun();
                   }
                 }