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

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

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

Loading…
Cancel
Save