Browse Source

mod:编辑 关闭 摄像头

panqiuyao 7 tháng trước cách đây
mục cha
commit
ca4e4492bd
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      frontend/src/views/Photography/check.vue

+ 3 - 2
frontend/src/views/Photography/check.vue

@@ -87,9 +87,11 @@ const socketStore = socket(); // WebSocket状态管理实例
 const emit = defineEmits([ 'confirm','onClose']);
 
 const confirm = ()=>{
+  hideVideo()
   emit('confirm')
 }
 const onClose = ()=>{
+  hideVideo()
   emit('onClose')
 }
 // 定义 props
@@ -248,11 +250,10 @@ onMounted(()=>{
  * 页面卸载时移除所有事件监听器。
  */
 onBeforeUnmount(() => {
+  hideVideo()
   clientStore.ipc.removeAllListeners(icpList.camera.takePictures);
   clientStore.ipc.removeAllListeners(icpList.camera.PreviewHide);
   clientStore.ipc.removeAllListeners(icpList.camera.PreviewShow);
-
-
 })
 </script>
 <style scoped lang="scss">