Toggle navigation
Toggle navigation
This project
Loading...
Sign in
OPENTECH
/
yoho-node-ci
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
2
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
毕凯
7 years ago
Commit
deee08bc8da0ac1f58b8647720619dec719ae195
1 parent
825a7a82
用户信息完善
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
apps/web/actions/users.js
public/src/components/common/Sidebar.vue
apps/web/actions/users.js
View file @
deee08b
...
...
@@ -65,6 +65,9 @@ const user = {
ctx
.
body
=
{
code
:
200
};
},
info
(
ctx
)
{
ctx
.
body
=
ctx
.
session
.
user
;
}
};
...
...
@@ -73,5 +76,6 @@ r.get('/new', user.new_page);
r
.
get
(
'/edit'
,
user
.
edit_page
);
r
.
post
(
'/save'
,
user
.
save
);
r
.
post
(
'/del'
,
user
.
del
);
r
.
get
(
'/info'
,
user
.
info
);
module
.
exports
=
r
;
\ No newline at end of file
...
...
public/src/components/common/Sidebar.vue
View file @
deee08b
...
...
@@ -2,7 +2,7 @@
<div class="sidebar">
<div class="sidebar-user">
<Avatar icon="person" size="large" :src="userImg" />
<span class="username">
Username
</span>
<span class="username">
{{user.username}}
</span>
</div>
<Menu class="sidebar-menu" active-name="1-2" theme="light" width="auto" :open-names="['1']">
<Submenu name="1">
...
...
@@ -131,12 +131,21 @@
<script>
import userImg from '../../../images/photos/user1.png'
import axios from 'axios'
export default {
data() {
data() {
return {
userImg
userImg,
user: {}
}
}
},
async created() {
const result = await axios.get('/users/info')
if (result.status === 200) {
this.user = result.data
}
}
}
</script>
...
...
Please
register
or
login
to post a comment