<#ibizinclude> ../@MACRO/LAYOUTPANEL_VIEW.template.ftl </#ibizinclude> <#ibizinclude> ../@MACRO/VIEW_HEADER-BASE.vue.ftl </#ibizinclude> <#assign mounted_block> this.timeEvent = setInterval(() => { if(this.countdown === 0) { this.gotoLoginView(); } this.countdown--; }, 1000); </#assign> <#ibizinclude> ../@MACRO/VIEW_CONTENT-BASE.vue.ftl </#ibizinclude> /** * 倒计时 * * @type {number} * @memberof LogoutView */ public countdown: number = 5; /** * 定时标识 * * @type {*} * @memberof LogoutView */ public timeEvent: any; /** * 跳转登录页 * * @memberof LogoutView */ public gotoLoginView() { if(this.timeEvent) { clearInterval(this.timeEvent); this.$router.push({name: 'login'}); } } /** * vue 生命周期 * * @memberof Default */ public destroyed() { if (this.timeEvent) { clearInterval(this.timeEvent); } } <#ibizinclude> ../@MACRO/VIEW_BOTTOM-BASE.vue.ftl </#ibizinclude> <#ibizinclude> ../@MACRO/VIEW-BASE.style.ftl </#ibizinclude>