pcpuma_unam_operador/components/layouts/Header.vue
2023-01-10 17:25:06 -06:00

64 lines
1.4 KiB
Vue

<template>
<header>
<div class="container py-3">
<div
class="columns is-mobile is-gapless is-vcentered is-justify-content-space-between"
>
<a
href="https://www.unam.mx/"
class="column is-5-mobile is-3-tablet is-one-fifth-widescreen ml-3"
target="_blank"
>
<b-image :src="require('@/assets/logo_unam.png')" alt="logo_unam" />
</a>
<a
href="https://pcpuma.unam.mx/"
class="column is-5-mobile is-3-tablet is-one-fifth-widescreen mr-3"
target="_blank"
v-if="!logo"
>
<b-image :src="require('@/assets/icon.png')" alt="logo_pcpuma" />
</a>
<div
class="column is-5-mobile is-3-tablet is-one-fifth-widescreen mr-3"
v-else
>
<b-image :src="logo" alt="logo" />
</div>
</div>
</div>
</header>
</template>
<script>
import jwt_decode from 'jwt-decode'
export default {
data() {
return { logo: '' }
},
created() {
const token = this.$getToken.tokenStr()
let operador
try {
if (token) operador = jwt_decode(token).Operador
} catch (err) {
operador = null
}
if (operador && operador.tipoUsuario.id_tipo_usuario > 2)
this.logo = `${
process.env.api
}${operador.institucion.logo.replace('.', '')}`
},
}
</script>
<style scoped>
header {
background-color: #1d3d6f;
}
</style>