网页刷新/浏览器关闭调用强制观摩关闭接口

master
吕天方 6 months ago
parent 04da9e38de
commit 09dcf07a4c

@ -4,7 +4,7 @@
* @Author: JC9527
* @Date: 2024-01-09 23:08:15
* @LastEditors: JC9527
* @LastEditTime: 2024-08-15 10:16:07
* @LastEditTime: 2024-08-15 11:05:25
-->
<template>
<div class="map-main">
@ -627,21 +627,21 @@ export default {
methods: {
// /
beforeunloadHandler(event){
if(this.destID && this.imei) {
if(this.personInfo.info.userId && this.personInfo.info.imei) {
this._beforeUnload_time = new Date().getTime();
videoSurveillance({destId:this.destID,imei:this.imei,msgType:0}).then(res=>{
this.destID = "";
this.imei = "";
videoSurveillance({destId:this.personInfo.info.userId,imei:this.personInfo.info.imei,msgType:0}).then(res=>{
this.personInfo.info.userId = "";
this.personInfo.info.imei = "";
})
}
},
unloadHandler(e){
this._gap_time = new Date().getTime()-this._beforeUnload_time;
if(this._gap_time <= 5){
if(this.destID && this.imei) {
videoSurveillance({destId:this.destID,imei:this.imei,msgType:0}).then(res=>{
this.destID = "";
this.imei = "";
if(this.personInfo.info.userId && this.personInfo.info.imei) {
videoSurveillance({destId:this.personInfo.info.userId,imei:this.personInfo.info.imei,msgType:0}).then(res=>{
this.personInfo.info.userId = "";
this.personInfo.info.imei = "";
})
}
}

Loading…
Cancel
Save