From 99f97b11a334ce482db9aa91fca86dadbaffd716 Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期四, 17 十一月 2022 17:40:43 +0800
Subject: [PATCH] 我的代办修改
---
src/views/layout/components/Header/index.vue | 44 +++++++++++++++++++++-----------------------
1 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/src/views/layout/components/Header/index.vue b/src/views/layout/components/Header/index.vue
index 8525a7c..beefaf1 100644
--- a/src/views/layout/components/Header/index.vue
+++ b/src/views/layout/components/Header/index.vue
@@ -1,6 +1,6 @@
<template>
<!-- 澶撮儴 -->
- <el-header>
+ <el-header v-if="show">
<!-- 宸︿晶鑿滃崟 -->
<div class="header-left">
<div class="menu-left__item" v-for="(item, index) in menuLeftList" :key="item.id" @click="changeActive(index)">
@@ -51,12 +51,6 @@
</el-card>
</div>
</div>
- <!-- 璁剧疆 -->
- <!-- <div class="menu-right__item btn">
- <el-tooltip effect="dark" content="璐︽埛璁剧疆" placement="bottom-end" :hide-after="1000">
- <i class="el-icon-s-tools"></i>
- </el-tooltip>
- </div> -->
<!-- 閫�鍑虹櫥褰� -->
<div class="menu-right__item btn" @click="loginout">
<el-tooltip effect="dark" content="閫�鍑虹櫥褰�" placement="bottom-end" :hide-after="1000">
@@ -157,10 +151,11 @@
],
keyword: '',
info:null,
+ show:false
};
},
created() {
- this.getLoginInfo();
+ this.setLoginInfo()
},
methods: {
baseInfo() {
@@ -198,7 +193,6 @@
sessionStorage.clear();
this.$router.push({ path: "/login" })
}).catch(err => {
- console.log(err);
})
},
// 鏀瑰彉閫変腑鐘舵��
@@ -211,22 +205,25 @@
}
})
},
- // 鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅
- getLoginInfo() {
+ // 璁剧疆鐢ㄦ埛鍩烘湰淇℃伅
+ async setLoginInfo() {
const info = JSON.parse(sessionStorage.getItem('user'));
if (info) {
this.user = info;
} else {
+ this.user = await this.getLoginInfo();
+ }
+ this.show = true
+ },
+ // 鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅
+ async getLoginInfo(){
const name = sessionStorage.getItem('name');
- this.$axios({
+ let res = await this.$axios({
method: 'get',
url: 'sccg/admin/info?name=' + name,
})
- .then(res => {
- sessionStorage.setItem('user', JSON.stringify(res.data));
- this.user = res.data;
- })
- }
+ sessionStorage.setItem('user', JSON.stringify(res.data));
+ return res.data
}
}
};
@@ -253,7 +250,7 @@
.header-left {
display: flex;
-
+ flex: 1;
.menu-left__item {
width: 120px;
@@ -278,9 +275,10 @@
.header-right {
display: flex;
-
+ padding-left: 10vw;
+ flex: 1;
.item {
- width: 60px;
+ width: 100%;
position: relative;
:deep(.is-fixed) {
@@ -295,12 +293,12 @@
}
.search {
- width: 200px;
+ flex: 3;
}
.user {
margin-left: 20px;
- width: 120px;
+ flex: 2;
display: flex;
align-items: center;
justify-content: center;
@@ -335,7 +333,7 @@
}
.btn {
- width: 60px;
+ flex: 1;
font-size: 20px;
position: relative;
--
Gitblit v1.8.0