diff --git a/src/App.vue b/src/App.vue index b6aa9b9ea..d0911b674 100644 --- a/src/App.vue +++ b/src/App.vue @@ -225,109 +225,109 @@ export default { } }, mounted() { - this.setTheme(this.getTheme) - //实现对字符码的截获,keypress中屏蔽了这些功能按键 - document.onkeypress = this.banBackSpace - //对功能按键的获取 - document.onkeydown = this.banBackSpace - this.visibilitychangeFn = (e) => { //这个方法是监测浏览器窗口发生变化的时候执行 - // 切换到当前页面 - if (document.hidden == false) { - const userInfoModifyTime = this.userInfoModifyTime - const userInfoModifyTimeInLocalStorage = localStorage.getItem('userInfoModifyTime') - - // 用户未切换 不执行任何操作 - if (userInfoModifyTime === userInfoModifyTimeInLocalStorage) { - return - } - - if (userInfoModifyTimeInLocalStorage === null && webLoginType === 'idm') { - this.$store.dispatch('syncStorageData') - - const currentPage = this.$route.name - if (currentPage === 'Login') { - return - } - this.currentMinute = 3 - this.loading && this.loading.close() - this.loading = this.$loading({ - lock: true, - // text: 'Loading', - // spinner: 'el-icon-loading', - // background: 'rgba(0, 0, 0, 0.7)' - }); - this.messageForLogin && this.messageForLogin.close() - this.messageForLogin = this.$message({ - message: `用户已退出,${this.currentMinute}秒后将跳转到登录1页面`, - type: 'warning' - }) - - - this.intervalForLogin = setInterval(() => { - if (this.currentMinute === 0) { - clearInterval(this.intervalForLogin) - this.loading.close() - - this.$router.push('/login') - console.log('切换到登录页面', currentPage) - } - this.currentMinute-- - this.messageForLogin.message = `用户已退出,${this.currentMinute}秒后将跳转到登录页面` - }, 0) - - } else if (userInfoModifyTime !== userInfoModifyTimeInLocalStorage && webLoginType === 'idm') { - this.$store.dispatch('syncStorageData') - - console.log('用户信息已更改,同步数据') - - this.currentMinute = 3 - - this.loading && this.loading.close() - this.loading = this.$loading({ - lock: true, - // text: 'Loading', - // spinner: 'el-icon-loading', - // background: 'rgba(0, 0, 0, 0.7)' - }); - - this.messageForHome && this.messageForHome.close() - this.messageForHome = this.$message({ - message: `用户已切换,${this.currentMinute}秒后将跳转到用户首页`, - type: 'warning' - }) - this.intervalForHome = setInterval(() => { - if (this.currentMinute === 0) { - clearInterval(this.intervalForHome) - this.loading.close() - - this.$router.push({ - path: '/redirect', - query: '/home2' - }) - } - this.currentMinute-- - this.messageForHome.message = `用户已切换,${this.currentMinute}秒后将跳转到用户首页` - }, 1000) - - // const route = this.$router.resolve('/home') - // this.$router.push({ - // path: '/redirect', - // query: '/home' - // }) - // location.reload(); - } - - } - } - document.addEventListener('visibilitychange', this.visibilitychangeFn); + // this.setTheme(this.getTheme) + // //实现对字符码的截获,keypress中屏蔽了这些功能按键 + // document.onkeypress = this.banBackSpace + // //对功能按键的获取 + // document.onkeydown = this.banBackSpace + // this.visibilitychangeFn = (e) => { //这个方法是监测浏览器窗口发生变化的时候执行 + // // 切换到当前页面 + // if (document.hidden == false) { + // const userInfoModifyTime = this.userInfoModifyTime + // const userInfoModifyTimeInLocalStorage = localStorage.getItem('userInfoModifyTime') + // + // // 用户未切换 不执行任何操作 + // if (userInfoModifyTime === userInfoModifyTimeInLocalStorage) { + // return + // } + // + // if (userInfoModifyTimeInLocalStorage === null && webLoginType === 'idm') { + // this.$store.dispatch('syncStorageData') + // + // const currentPage = this.$route.name + // if (currentPage === 'Login') { + // return + // } + // this.currentMinute = 3 + // this.loading && this.loading.close() + // this.loading = this.$loading({ + // lock: true, + // // text: 'Loading', + // // spinner: 'el-icon-loading', + // // background: 'rgba(0, 0, 0, 0.7)' + // }); + // this.messageForLogin && this.messageForLogin.close() + // this.messageForLogin = this.$message({ + // message: `用户已退出,${this.currentMinute}秒后将跳转到登录1页面`, + // type: 'warning' + // }) + // + // + // this.intervalForLogin = setInterval(() => { + // if (this.currentMinute === 0) { + // clearInterval(this.intervalForLogin) + // this.loading.close() + // + // this.$router.push('/login') + // console.log('切换到登录页面', currentPage) + // } + // this.currentMinute-- + // this.messageForLogin.message = `用户已退出,${this.currentMinute}秒后将跳转到登录页面` + // }, 0) + // + // } else if (userInfoModifyTime !== userInfoModifyTimeInLocalStorage && webLoginType === 'idm') { + // this.$store.dispatch('syncStorageData') + // + // console.log('用户信息已更改,同步数据') + // + // this.currentMinute = 3 + // + // this.loading && this.loading.close() + // this.loading = this.$loading({ + // lock: true, + // // text: 'Loading', + // // spinner: 'el-icon-loading', + // // background: 'rgba(0, 0, 0, 0.7)' + // }); + // + // this.messageForHome && this.messageForHome.close() + // this.messageForHome = this.$message({ + // message: `用户已切换,${this.currentMinute}秒后将跳转到用户首页`, + // type: 'warning' + // }) + // this.intervalForHome = setInterval(() => { + // if (this.currentMinute === 0) { + // clearInterval(this.intervalForHome) + // this.loading.close() + // + // this.$router.push({ + // path: '/redirect', + // query: '/home2' + // }) + // } + // this.currentMinute-- + // this.messageForHome.message = `用户已切换,${this.currentMinute}秒后将跳转到用户首页` + // }, 1000) + // + // // const route = this.$router.resolve('/home') + // // this.$router.push({ + // // path: '/redirect', + // // query: '/home' + // // }) + // // location.reload(); + // } + // + // } + // } + // document.addEventListener('visibilitychange', this.visibilitychangeFn); }, beforeDestroy() { - document.onkeypress = null - document.onkeydown = null - document.removeEventListener('visibilitychange', this.visibilitychangeFn) - clearInterval(this.intervalForLogin) - clearInterval(this.intervalForHome) + // document.onkeypress = null + // document.onkeydown = null + // document.removeEventListener('visibilitychange', this.visibilitychangeFn) + // clearInterval(this.intervalForLogin) + // clearInterval(this.intervalForHome) } } diff --git a/src/pages/regulatoryRepository/accessStandardsAndRegulations/pages/details.vue b/src/pages/regulatoryRepository/accessStandardsAndRegulations/pages/details.vue index ed432e8f9..dd221e1d9 100644 --- a/src/pages/regulatoryRepository/accessStandardsAndRegulations/pages/details.vue +++ b/src/pages/regulatoryRepository/accessStandardsAndRegulations/pages/details.vue @@ -133,7 +133,7 @@