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.

91 lines
2.7 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'
2 years ago
import Cookie from 'js-cookie'
4 years ago
export default {
data() {
return {
token: util.local.get(Setting.tokenKey),
};
},
mounted(){
2 years ago
this.$route.query.manager && Cookie.set('manager', 1)
4 years ago
},
methods: {
toIndex(){
this.$refs.nav.jump({
index: '/index/list',
title: '首页'
})
},
exit(){
3 years ago
const url = location.href
2 years ago
let href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8082/#/` :
`${url.includes('huorantech.cn') ? `http://www.occupationlab.com` : location.origin}${Cookie.get('manager') ?
'/admin' :
(url.includes('huorantech.cn') || url.includes('izhixinyun.com')) ?
'' :
'/student'}/#/`
3 years ago
let assessmentId = sessionStorage.getItem('assessmentId')
if (assessmentId != 'null' && assessmentId != null && assessmentId != ''){
2 years ago
href += `ass/list`
3 years ago
}else{
const cid = sessionStorage.getItem('cid')
2 years ago
href += `station/preview?courseId=${cid}&curriculumName=银行项目`
3 years ago
}
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>