Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
3d27d359
authored
2023-02-16 15:07:57 +0800
by
yangwei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改用户名显示及系统名称显示
1 parent
f587b9a9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
13 deletions
src/layout/components/Navbar.vue
src/permission.js
src/store/modules/user.js
src/views/home/dataView/index.vue
src/layout/components/Navbar.vue
View file @
3d27d35
...
...
@@ -5,7 +5,7 @@
{{
dicData
[
"sysCode"
]
&&
dicData
[
"sysCode"
][
0
].
DNAME
}}
</div>
<div
class=
"user"
>
欢迎进入系统
{{
name
}}
欢迎进入系统
{{
userInfo
.
name
}}
<span
@
click=
"onCancel"
>
<svg-icon
icon-class=
"close"
class=
"closeStyle"
/>
退出系统
</span
>
...
...
@@ -30,13 +30,14 @@ export default {
sidebarRight
,
},
computed
:
{
...
mapGetters
([
"sidebar"
,
"dicData"
,
"
name
"
]),
...
mapGetters
([
"sidebar"
,
"dicData"
,
"
userInfo
"
]),
},
methods
:
{
onCancel
()
{
logout
()
.
then
((
res
)
=>
{
sessionStorage
.
removeItem
(
"token"
);
this
.
$store
.
dispatch
(
"user/resetState"
);
this
.
$router
.
replace
({
path
:
"/login"
,
query
:
{
...
...
src/permission.js
View file @
3d27d35
...
...
@@ -37,8 +37,6 @@ router.beforeEach(async (to, from, next) => {
"permission/generateRoutes"
,
getMenuData
);
// 获取用户信息
await
store
.
dispatch
(
"user/getUserInfo"
);
router
.
addRoutes
([
...
accessRoutes
,
{
path
:
"*"
,
redirect
:
"/404"
,
hidden
:
true
},
...
...
src/store/modules/user.js
View file @
3d27d35
import
{
getUserInfo
}
from
"@/api/user"
;
const
state
=
{
hasUser
:
false
,
name
:
""
,
avatar
:
"https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
,
userInfo
:
null
,
};
const
mutations
=
{
SET_USERINFO
:
(
state
,
data
)
=>
{
state
.
hasUser
=
true
;
state
.
userInfo
=
data
;
state
.
name
=
data
.
loginName
;
},
RESET_USER
:
(
state
)
=>
{
state
.
hasUser
=
false
;
state
.
userInfo
=
null
;
},
};
const
actions
=
{
getUserInfo
({
commit
})
{
if
(
!
state
.
hasUser
)
{
return
new
Promise
(
async
(
resolve
)
=>
{
let
{
result
:
res
}
=
await
getUserInfo
();
commit
(
"SET_USERINFO"
,
res
);
resolve
(
true
);
});
}
else
{
return
}
},
reset
dict
({
commit
})
{
reset
State
({
commit
})
{
commit
(
"RESET_USER"
);
},
};
...
...
src/views/home/dataView/index.vue
View file @
3d27d35
...
...
@@ -9,7 +9,7 @@
<div
class=
"d-flex"
>
<dv-decoration-8
class=
"dv-dec-8"
:color=
"decorationColor"
/>
<div
class=
"title"
>
<span
class=
"title-text"
>
汉中市不动产监管大屏
</span>
<span
class=
"title-text"
>
{{
products
.
name
}}
}
</span>
<dv-decoration-5
:dur=
"1"
class=
"dv-dec-5"
...
...
@@ -60,6 +60,9 @@ export default {
},
500
);
},
},
computed
:
{
...
mapGetters
([
"products"
]),
},
};
</
script
>
...
...
Please
register
or
sign in
to post a comment