Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
agcs2.0-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
liang
agcs2.0-web
Commits
65a074b8
You need to sign in or sign up before continuing.
Commit
65a074b8
authored
Nov 30, 2022
by
miaojiale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户信息
parent
2ce0ddeb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
10 deletions
+28
-10
index.vue
src/components/layout/index.vue
+27
-10
user.js
src/store/modules/user.js
+1
-0
No files found.
src/components/layout/index.vue
View file @
65a074b8
...
...
@@ -45,7 +45,7 @@
</div>
<div
v-if=
"allianceToken"
class=
"userInfo"
>
<div
class=
"white"
></div>
<div
class=
"text"
>
欢迎,
LIXid胡
</div>
<div
class=
"text"
>
欢迎,
{{
userInfo
.
name
}}
</div>
<div
class=
"exit"
@
click=
"logout"
>
退出
</div>
</div>
</header>
...
...
@@ -126,6 +126,7 @@ export default {
},
allianceToken
:
getAccessToken
(),
currentRoute
:
this
.
$route
.
path
,
userInfo
:
{},
}
},
watch
:
{
...
...
@@ -140,6 +141,7 @@ export default {
// if (localStorage.getItem('allianceToken')) {
// this.$router.push('/datacenter/home')
// }
this
.
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
"
userInfo
"
))
},
methods
:
{
handleSubmit
(
name
)
{
...
...
@@ -166,17 +168,31 @@ export default {
})
},
logout
()
{
this
.
$Modal
.
confirm
({
const
h
=
this
.
$createElement
this
.
$msgbox
({
title
:
"
提示
"
,
content
:
'
<p style="text-align:center;font-size:16px;">是否确认退出?</p>
'
,
onOk
:
()
=>
{
setTimeout
(()
=>
{
localStorage
.
removeItem
(
"
agcs
"
)
message
:
h
(
"
p
"
,
null
,
[
h
(
"
span
"
,
null
,
"
是否确认退出登录?
"
)]),
showCancelButton
:
true
,
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
beforeClose
:
(
action
,
instance
,
done
)
=>
{
if
(
action
===
"
confirm
"
)
{
instance
.
confirmButtonLoading
=
true
instance
.
confirmButtonText
=
"
执行中...
"
this
.
$store
.
dispatch
(
"
user/logout
"
).
then
(()
=>
{
this
.
allianceToken
=
""
},
500
)
done
()
instance
.
confirmButtonLoading
=
false
})
}
else
{
done
()
}
},
onCancel
:
()
=>
{},
}).
then
((
action
)
=>
{
// this.$message({
// type: "info",
// message: "action: " + action,
// })
})
},
},
...
...
@@ -247,6 +263,7 @@ export default {
font-size
:
20px
;
font-family
:
AlibabaPuHuiTiM
;
color
:
#ffffff
;
margin
:
10px
0
;
}
.exit
{
font-size
:
16px
;
...
...
src/store/modules/user.js
View file @
65a074b8
...
...
@@ -35,6 +35,7 @@ const mutations = {
setAccessToken
(
accessToken
)
},
setUserInfo
(
state
,
userInfo
)
{
localStorage
.
setItem
(
"
userInfo
"
,
JSON
.
stringify
(
userInfo
))
state
.
userInfo
=
userInfo
},
setGroup
(
state
,
group
)
{
...
...
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