Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
precision-effect
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
precision-effect
Commits
12266064
Commit
12266064
authored
Jun 10, 2023
by
王晓倩
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
6dc2f81f
e227e145
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
Navbar.vue
precision-effect-web/src/layout/components/Navbar.vue
+11
-7
getters.js
precision-effect-web/src/store/getters.js
+1
-0
user.js
precision-effect-web/src/store/modules/user.js
+6
-1
No files found.
precision-effect-web/src/layout/components/Navbar.vue
View file @
12266064
...
...
@@ -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
()
{
...
...
precision-effect-web/src/store/getters.js
View file @
12266064
...
...
@@ -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
,
...
...
precision-effect-web/src/store/modules/user.js
View file @
12266064
...
...
@@ -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
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment