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

Merge remote-tracking branch 'origin/master'

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