Commit 12266064 authored by 王晓倩's avatar 王晓倩

Merge remote-tracking branch 'origin/master'

parents 6dc2f81f e227e145
......@@ -7,19 +7,21 @@
<div class="right-menu">
<template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" />
<!-- <search id="header-search" class="right-menu-item" />-->
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<!-- <screenfull id="screenfull" class="right-menu-item hover-effect" />-->
<el-tooltip content="布局大小" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip>
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">-->
<!-- <size-select id="size-select" class="right-menu-item hover-effect" />-->
<!-- </el-tooltip>-->
</template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<img :src="avatar" class="user-avatar">
<!-- <img :src="avatar" class="user-avatar">-->
<div >{{this.name+'/'+this.deptName}}</div>
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
......@@ -60,7 +62,9 @@ export default {
...mapGetters([
'sidebar',
'avatar',
'device'
'device',
'name',
'deptName'
]),
setting: {
get() {
......
......@@ -7,6 +7,7 @@ const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
deptName:state => state.user.deptName,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
permissions: state => state.user.permissions,
......
......@@ -9,6 +9,7 @@ const user = {
roles: [],
permissions: [],
systemSetting:{},
deptName:'',
deptId: '',
},
......@@ -34,6 +35,9 @@ const user = {
SET_DEPTID: (state,deptId) =>{
state.deptId = deptId;
},
SET_DEPTNAME: (state,deptName) =>{
state.deptName = deptName;
},
},
actions: {
......@@ -60,7 +64,7 @@ const user = {
getInfo().then(res => {
const user = res.user
const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
console.log("getInfo",)
console.log("getInfo",user)
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
......@@ -72,6 +76,7 @@ const user = {
// 默认配置
commit('SET_SYSTEMSETTING', res.systemSetting)
commit('SET_DEPTID', user.deptId);
commit('SET_DEPTNAME', user.dept.deptName);
console.log(res.systemSetting)
resolve(res)
}).catch(error => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment