yf_zd 5 rokov pred
rodič
commit
054e9c033b
1 zmenil súbory, kde vykonal 12 pridanie a 35 odobranie
  1. 12 35
      bigdata2/src/components/Index.vue

+ 12 - 35
bigdata2/src/components/Index.vue

@@ -4,22 +4,7 @@
 			<div class="navbarBtn">
 				<!-- 用户 -->
 				<div class="userinfo">
-					<img src="@/assets/images/12.jpg" class="userheadImg" alt="" />
-					<el-dropdown
-						trigger="click"
-						@command="dropdownHandle"
-						placement="top"
-					>
-						<span class="el-dropdown-link" style="cursor: pointer; color: #fff">
-							{{ username }}
-							<i class="el-icon-arrow-down el-icon--right"></i>
-						</span>
-						<el-dropdown-menu slot="dropdown">
-							<el-dropdown-item command="personMsg">个人中心</el-dropdown-item>
-							<el-dropdown-item command="editPwd">修改密码</el-dropdown-item>
-							<el-dropdown-item command="outSys">退出</el-dropdown-item>
-						</el-dropdown-menu>
-					</el-dropdown>
+					<img :src="userphoto" class="userheadImg" alt="" />{{ username }}
 				</div>
 				<!-- 标题 -->
 				<div class="caption">
@@ -153,6 +138,7 @@ export default {
 			},], //首页菜单
 			// activePath:'',
 			username: '',
+			userphoto:'',
 			userHeadImg: '',
 			resetPassDialogVisible: false,
 			resetPassForm: {
@@ -170,18 +156,9 @@ export default {
 		}
 	},
 	created: function () {
-		// this.username = localStorage.getItem('username')
-		// this.getNavList()
-		// this.activePath=window.sessionStorage.getItem('activePath')
-		// document.body.className = window.sessionStorage.getItem('bodyCalss')
+		this.getuserinfo()
 	},
 	computed: {
-		// activePath: function () {
-		// 	return this.$store.state.activePath
-		// },
-		// homePath: function () {
-		// 	return this.$store.state.homePath
-		// }
 	},
 	watch: {
 		'$route.path': function (newVal) {
@@ -194,15 +171,6 @@ export default {
 		}
 	},
 	mounted() {
-		// this.$EventBus.$on('refresh', (data) => {
-		// 	console.log('bus')
-		// 	this.refresh = false
-		// 	this.$nextTick( ()=> {
-		// 		this.refresh = true
-		// 	})
-		// })
-		this.username = localStorage.getItem('username')
-		// this.getNavList()
 	},
 	methods: {
 		dropdownHandle(command) {
@@ -214,6 +182,15 @@ export default {
 				this.$router.push({ path: command })
 			}
 		},
+		getuserinfo() {
+			this.$axios({
+				method: 'post',
+				url: '/api/userinfo_'
+			}).then((res) => {
+				this.username = res.data.username
+				this.userphoto = res.data.userphoto
+			})
+		},
 		getNavList() {
 			this.$axios({
 				method: 'GET',