| | |
| | | <template> |
| | | <el-container> |
| | | <el-header height="60" class="student-header header" :style="{'background-color': logo!='none'?'#fff':'#409eff'}"> |
| | | <el-header height="60" class="student-header header" :style="{'background-color': backgroundColor}"> |
| | | <div class="head-language" v-if="langFlag"> |
| | | <!--<lang-select class="right-menu-item" />--> |
| | | <!--国际化的语言选择--> |
| | |
| | | return { |
| | | defaultUrl: '/index', |
| | | logoHeight: 50, |
| | | backgroundColor: '#fff', |
| | | userInfo: { |
| | | imagePath: null |
| | | }, |
| | |
| | | if (this.productType === 'API_Fan') { |
| | | this.logoUrl = require('@/assets/logo-apifan.png') |
| | | } else if (val === 'none') { |
| | | this.backgroundColor = '#409eff' |
| | | this.logoUrl = require('@/assets/logo-t.png') |
| | | } else if (val !== null) { |
| | | this.logoUrl = val |
| | | } else if (sessionLogoUrl !== null) { |
| | | this.logoUrl = sessionLogoUrl |
| | | } |
| | | console.log('logoUrl:' + this.logoUrl) |
| | | sessionStorage.setItem('logoUrl', this.logoUrl) |
| | | sessionStorage.setItem('backgroundColor', this.backgroundColor) |
| | | } |
| | | }, |
| | | mounted () { |
| | | let sessionLogoUrl = sessionStorage.getItem('logoUrl') |
| | | let sessionBackgroundColor = sessionStorage.getItem('backgroundColor') |
| | | if (sessionLogoUrl !== null) { |
| | | this.logoUrl = sessionLogoUrl |
| | | this.backgroundColor = sessionBackgroundColor |
| | | } |
| | | sessionStorage.setItem('backgroundColor', this.backgroundColor) |
| | | window.addEventListener('beforeunload', this.handleBeforeUnload) |
| | | window.addEventListener('unload', this.handleUnload) |
| | | }, |
| | | beforeDestroy () { |
| | | window.removeEventListener('beforeunload', this.handleBeforeUnload) |
| | | window.removeEventListener('unload', this.handleUnload) |
| | | }, |
| | | methods: { |
| | | handleBeforeUnload: function () { |
| | | sessionStorage.setItem('logoUrl', this.logoUrl) |
| | | }, |
| | | handleUnload: function () { |
| | | console.log('已经刷新') |
| | | }, |
| | | logout: function () { |
| | | window.opener = null |