You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
788 B

<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
import ast from '@/utils/astrict.js'
import { faceStop } from '@/api/user/user'
export default {
name: 'App',
data() {
return {
intval: null
}
},
created() {
this.intval = ast()
// window.addEventListener('beforeunload', (event) => {
// faceStop().then(res => { console.log(res) })
// })
window.onbeforeunload = (e) => {
e = e || window.event
if (e) {
e.returnValue = '关闭提示'
}
faceStop().then(res => { console.log(res) })
// Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
return '关闭提示'
}
},
destroyed() {
if (this.intval) {
clearInterval(this.intval)
}
}
}
</script>