|
@@ -14,14 +14,16 @@
|
|
|
<template v-slot:activator="{ props }">
|
|
|
<div class="d-flex ml-3 pl-2 align-center cursor-pointer" v-bind="props">
|
|
|
<v-avatar>
|
|
|
- <v-img alt="" :src="getUserAvatar(baseInfo?.avatar, baseInfo?.sex)"></v-img>
|
|
|
+ <v-img alt="" :src="getUserAvatar(schoolInfo?.school?.headImg, schoolInfo?.school?.teacherSex)"></v-img>
|
|
|
</v-avatar>
|
|
|
- <div class="ml-2 commonHover">{{ formatName(baseInfo?.name ?? baseInfo?.phone) }}</div>
|
|
|
+ <div class="ml-2 commonHover">
|
|
|
+ {{ formatName(schoolInfo?.school?.schoolName) + ' - ' + schoolInfo?.school?.teacherNickname ?? schoolInfo?.school?.phone }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<v-list>
|
|
|
- <v-list-item v-for="(item, index) in items" :key="index" @click="item.change">
|
|
|
+ <v-list-item v-for="(item, index) in menuList" :key="index" @click="item.change">
|
|
|
<template v-slot:prepend>
|
|
|
<v-icon :icon="item.icon"></v-icon>
|
|
|
</template>
|
|
@@ -30,8 +32,6 @@
|
|
|
</v-list>
|
|
|
</v-menu>
|
|
|
</div>
|
|
|
- <!-- 消息通知 -->
|
|
|
- <MessageNotification class="commonHover2" path="/recruit/enterprise/chatTools"></MessageNotification>
|
|
|
</div>
|
|
|
</div>
|
|
|
</v-toolbar>
|
|
@@ -39,12 +39,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { computed, ref, onMounted } from 'vue'
|
|
|
+import { ref, onMounted } from 'vue'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
import { useUserStore } from '@/store/user'; const userStore = useUserStore()
|
|
|
import { useRouter } from 'vue-router'; const router = useRouter()
|
|
|
import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
|
-import MessageNotification from '../message.vue'
|
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
|
import { formatName } from '@/utils/getText';
|
|
|
defineOptions({ name: 'teacher-navbar' })
|
|
@@ -59,32 +58,28 @@ defineProps({
|
|
|
const showBall = ref(false)
|
|
|
|
|
|
onMounted(() => {
|
|
|
- if (getToken(1)) {
|
|
|
+ if (getToken()) {
|
|
|
showBall.value = true
|
|
|
}
|
|
|
})
|
|
|
|
|
|
const handleLogoClick = () => { window.open('/recruitHome') } // 点击logo
|
|
|
|
|
|
-// 退出登录、切换求职者
|
|
|
-const handleLogout = async (exit = true) => {
|
|
|
- if (exit) await userStore.userLogout(2)
|
|
|
- router.push({ path: '/recruitHome' })
|
|
|
+// 退出登录
|
|
|
+const handleLogout = async () => {
|
|
|
+ await userStore.userLogout(1)
|
|
|
+ router.push({ path: '/flame' })
|
|
|
}
|
|
|
|
|
|
const menuList = ref([
|
|
|
- { title: t('setting.editPassword'), icon: 'mdi-shield-lock-open-outline', change: () => router.push({ path: '/recruit/enterprise/staffChangePassword' }) },
|
|
|
{ title: t('setting.logOut'), icon: 'mdi-logout', change: handleLogout }
|
|
|
])
|
|
|
-const items = computed(() => {
|
|
|
- return menuList.value.filter(item => !item.hidden)
|
|
|
-})
|
|
|
|
|
|
-// 企业logo、用户基本信息
|
|
|
-let baseInfo = ref(JSON.parse(localStorage.getItem('entBaseInfo')) || {})
|
|
|
+// 学校信息
|
|
|
+let schoolInfo = ref(JSON.parse(localStorage.getItem('schoolInfo')) || {})
|
|
|
|
|
|
userStore.$subscribe((mutation, state) => {
|
|
|
- if (Object.keys(state.entBaseInfo).length) baseInfo.value = state.entBaseInfo
|
|
|
+ if (Object.keys(state.schoolInfo).length) schoolInfo.value = state.schoolInfo
|
|
|
})
|
|
|
|
|
|
</script>
|
|
@@ -124,12 +119,4 @@ userStore.$subscribe((mutation, state) => {
|
|
|
color: var(--color-333);
|
|
|
font-size: 15px;
|
|
|
}
|
|
|
-.enterprise-septal-line {
|
|
|
- width: 1px;
|
|
|
- display: inline-block;
|
|
|
- height: 20px;
|
|
|
- vertical-align: middle;
|
|
|
- background-color: #fff;
|
|
|
- margin: 0 10px;
|
|
|
-}
|
|
|
</style>
|