| | |
| | | }, |
| | | created() { |
| | | this.setLoginInfo() |
| | | console.log(this.user) |
| | | }, |
| | | methods: { |
| | | baseInfo() { |
| | |
| | | sessionStorage.clear(); |
| | | this.$router.push({ path: "/login" }) |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | }, |
| | | // 改变选中状态 |
| | |
| | | async setLoginInfo() { |
| | | const info = JSON.parse(sessionStorage.getItem('user')); |
| | | if (info) { |
| | | console.log(info) |
| | | this.user = info; |
| | | } else { |
| | | this.user = await this.getLoginInfo(); |
| | | console.log(this.user) |
| | | } |
| | | this.show = true |
| | | }, |
| | |
| | | |
| | | .header-left { |
| | | display: flex; |
| | | |
| | | flex: 1; |
| | | .menu-left__item { |
| | | width: 120px; |
| | | |
| | |
| | | |
| | | .header-right { |
| | | display: flex; |
| | | |
| | | padding-left: 10vw; |
| | | flex: 1; |
| | | .item { |
| | | width: 60px; |
| | | width: 100%; |
| | | position: relative; |
| | | |
| | | :deep(.is-fixed) { |
| | |
| | | } |
| | | |
| | | .search { |
| | | width: 200px; |
| | | flex: 3; |
| | | } |
| | | |
| | | .user { |
| | | margin-left: 20px; |
| | | width: 120px; |
| | | flex: 2; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | } |
| | | |
| | | .btn { |
| | | width: 60px; |
| | | flex: 1; |
| | | font-size: 20px; |
| | | position: relative; |
| | | |