home跳转

This commit is contained in:
朱菊兰 2022-11-03 10:19:19 +08:00
parent cd977fbb29
commit 73a60d5da3
2 changed files with 15 additions and 4 deletions

View File

@ -11,10 +11,12 @@
<div class="right-menu">
<div v-if="showhome" class="right-menu-back" @click="toHome">
<!-- <div v-if="showhome" class="right-menu-back" @click="toHome">
<svg-icon class="item-icon" icon-class="home" style="height: 24px; width: 24px; vertical-align: -6px; margin-right: 2px;" />
{{ 'navbar.homepage' | i18nFilter }}
</div>
</div> -->
<div :style="showTitle ? 'color: #fff' : ''" class="right-menu-back" @click="toHome">
<svg-icon class="item-icon" icon-class="home" style="height: 24px; width: 24px; vertical-align: -6px; margin-right: 2px;" /></div>
<el-dropdown :style="showTitle ? 'color: #fff' : '#000'" class="avatar-container right-menu-item hover-effect" trigger="click">
<el-badge :hidden="alarmNum>0?false:true" :value="alarmNum" class="item" style="line-height: 0; margin: 0 10px; vertical-align: -3px" @click.native="handleAlarm">
<svg-icon style="width: 24px; height: 24px" class="item-icon" icon-class="alarm" />
@ -204,8 +206,12 @@ export default {
clearInterval(logoutInterval)
},
async toHome() {
this.$store.dispatch('app/setChoicepart')
this.$router.push('/')
// this.$store.dispatch('app/setChoicepart')
// this.$router.push('/')
if (localStorage.getItem('param')) {
const param = JSON.parse(window.atob(localStorage.getItem('param')))
window.location = 'https://www.baidu.com/?' + param
}
},
handleAlarm() {},
getAlarm() {

View File

@ -33,6 +33,11 @@ export default {
},
mounted() {
this.getModuleList()
const path = location.href
if (path.indexOf('?') !== -1) {
const param = path.split('?')
localStorage.setItem('param', window.btoa(JSON.stringify(param[1])))
}
},
methods: {
getModuleList() {