longyvfengyun
2022-03-01 c5d9d4ae30de0a6a0a160c0659bc7a85034398b2
src/components/PageHeader.vue
@@ -414,6 +414,13 @@
    };
  },
  methods: {
    closeBrowser() {
      this.$apis.login.closeBrowser().then(res=>{
        console.log(res);
      }).catch(error => {
        console.log(error);
      });
    },
    alarmAlert() {
      this.alarmAlertStatus = !this.alarmAlertStatus;
    },
@@ -1085,7 +1092,6 @@
        .getLicenseResTime()
        .then((res) => {
          let rs = JSON.parse(res.data.result);
          console.log(rs);
          if (rs.code == 1) {
            this.termDateShow = true;
            this.termDate = rs.data;
@@ -1307,6 +1313,19 @@
    this.changeSkin();
  },
  mounted() {
    let _beforeUnload_time = 0;
    let _unload_time = 0;
    // 监控浏览器关闭
    window.addEventListener('beforeunload', e=>{
      _beforeUnload_time = new Date().getTime();
    });
    window.addEventListener("unload", e=>{
      _unload_time = new Date().getTime();
      if(_unload_time-_beforeUnload_time<=1) {
        this.closeBrowser();
      }
    });
    // 启动请求
    this.startSearch();
    this.startLogUseCount();