import"./index-4f1337e8.js";import{_ as m}from"./_plugin-vue_export-helper-c27b6911.js";import{r as t,J as r,o as i,f as p,a as n,c,g as f,q as g}from"./index-ad591d72.js";const v={class:"card shadow"},h={key:0,id:"faceImg",src:"",alt:"",style:{}},w={__name:"video",setup(b){const s=t(!1),a=t("");let e=null;r(()=>{e&&e.close()}),i(()=>{});const d=l=>{s.value=l,l?(e=new WebSocket("ws://localhost:8888/ws"),e.onopen=()=>{console.log("连接成功")},e.onmessage=o=>{a.value=!0,o.data===1?console.log("校验成功"):o.data===0?console.log("校验失败"):document.getElementById("faceImg").src="data:image/jpg;base64,"+o.data},e.onclose=()=>{console.log("连接关闭"),e.close(),e=null,a.value=!1,s.value=!1}):(e.close(),e=null)};return(l,o)=>{const _=p("el-switch");return n(),c("div",v,[f(_,{modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=u=>s.value=u),onChange:d},null,8,["modelValue"]),a.value?(n(),c("img",h)):g("",!0)])}}},V=m(w,[["__scopeId","data-v-c55d07ab"]]);export{V as default};
