You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.5 KiB

4 years ago
<template>
3 years ago
<div class="header" ref="exitHeader">
<div class="inner" style="width: 100%">
<div class="logo" @click="toIndex" style="float: left">
4 years ago
<img src="../../assets/img/logo.png" alt="">
</div>
<div style="float: right;margin:0 60px;font-size: 18px">
<span style="cursor:pointer" @click="exit">
退出<i class="icon el-icon-s-unfold"></i>
</span>
</div>
4 years ago
</div>
</div>
</template>
<script>
import { mapState,mapActions } from 'vuex'
import Setting from '@/setting'
import util from '@/libs/util'
export default {
data() {
return {
token: util.local.get(Setting.tokenKey),
};
},
mounted(){
},
methods: {
toIndex(){
this.$refs.nav.jump({
index: '/index/list',
title: '首页'
})
},
exit(){
3 years ago
let href = ''
const url = location.href
const host = url.includes('huorantech.cn') ?
`http://www.occupationlab.com` :
process.env.NODE_ENV === 'development' ?
`http://192.168.31.155:8082` :
3 years ago
`http://121.37.12.51/student`
3 years ago
let assessmentId = sessionStorage.getItem('assessmentId')
if (assessmentId != 'null' && assessmentId != null && assessmentId != ''){
href = `${host}/#/ass/list`
}else{
const cid = sessionStorage.getItem('cid')
href = `${host}/#/station/preview?courseId=${cid}&curriculumName=银行项目`
}
location.href = href
},
4 years ago
},
3 years ago
watch: {
'$route.path': {
handler(newVal) {
this.$nextTick(() => {
console.log(newVal)
if(newVal === '/index/list') {
this.$refs.exitHeader.style.backgroundColor = 'rgb(250, 250, 250)'
}else {
this.$refs.exitHeader.style.backgroundColor = 'rgb(244, 245, 248)'
}
})
},
immediate: true
}
}
4 years ago
};
</script>
<style lang="scss" scoped>
.header{
3 years ago
width:100%;
4 years ago
display: flex;
align-items: center;
position: relative;
height: 68px;
// background-color: #fff;
3 years ago
background-color: rgb(244,245,248);
3 years ago
z-index: 1001;
4 years ago
.logo{
width: 500px;
margin-left: 42px;
cursor: pointer;
img{
width: 100%;
}
}
}
</style>