| | |
| | | </div> |
| | | <el-dropdown class="avatar-container" trigger="click"> |
| | | <div class="avatar-wrapper"> |
| | | <a class="user-avatar">{{ '中天'.slice(0,1) }}</a> |
| | | <a class="user-avatar">{{ user.name.slice(0,1) }}</a> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown" class="user-dropdown"> |
| | | <router-link to="/"> |
| | |
| | | import { mapGetters } from 'vuex' |
| | | // import Breadcrumb from '@/components/Breadcrumb' |
| | | // import Hamburger from '@/components/Hamburger' |
| | | import { |
| | | get, |
| | | post, |
| | | wpost, |
| | | postFile |
| | | } from "@/api/util/requestUtil.js" |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | 'avatar' |
| | | ]) |
| | | }, |
| | | data() { |
| | | return { |
| | | user: { |
| | | id: null, |
| | | name: 'value' |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getUser() |
| | | }, |
| | | methods: { |
| | | toggleSideBar() { |
| | | this.$store.dispatch('app/toggleSideBar') |
| | |
| | | async logout() { |
| | | // await this.$store.dispatch('user/logout') |
| | | this.$router.push(`/login?redirect=${this.$route.fullPath}`) |
| | | } |
| | | }, |
| | | getUser(){ |
| | | get(this.$url.info).then(res=>{ |
| | | this.user = res.data |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |