chenyc
2023-11-27 e9ef9bfe411bda655f6231f3213cb09039b9dbb7
src/views/login/index.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, ref } from "vue";
import {base64toFile} from '@/samples/faceApi'
import { formatDate } from "@/utils/formatTime";
import { formatDate ,jgTime} from "@/utils/formatTime";
import { confingInfoStore } from "@/stores/StoresConfing";
const msg = ref<string>("没识别到人脸...");
@@ -13,6 +13,7 @@
// 标识用的画布
const myCanvas = ref<HTMLCanvasElement | null>(null);
let imgSrc:'';
let chuansongTime;
// 实例人脸检查器
const myTracker: any = new tracking.ObjectTracker("face");
myTracker.setInitialScale(4);
@@ -37,6 +38,8 @@
    // 转文件
    // 识别框显示才能到传阿里云识别
    if(dialogVisible.value){
      // if(new Date())
      // chuansongTime=new Date()
      base64toFile(imgSrc)
    }
    setTimeout(() => {
@@ -55,7 +58,10 @@
  // 触发人脸检查器
  console.log('人脸识别初始化')
  const  isUseFaceRecogService = confingInfoStore().confingInfo.isUseFaceRecogService
  console.log('人脸识别',isUseFaceRecogService)
  // console.log('人脸识别',isUseFaceRecogService)
  let jg= jgTime(new Date(),new Date())
  console.log(jg)
  setInterval(function () {
    date.value= formatDate(new Date(),'YYYY-mm-dd HH:MM')
  }, 1000)