Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
XiTianSenMall
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
leiqingsong
XiTianSenMall
Commits
5b2fd269
Commit
5b2fd269
authored
4 years ago
by
leiqingsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
272c425e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
localGetter.js
H5/src/utils/localGetter.js
+5
-1
settings.vue
H5/src/views/settings.vue
+12
-1
No files found.
H5/src/utils/localGetter.js
View file @
5b2fd269
export
function
getUserId
()
{
if
(
localStorage
.
getItem
(
"user"
))
{
return
JSON
.
parse
(
localStorage
.
getItem
(
'user'
)).
userId
;
}
else
{
return
""
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
H5/src/views/settings.vue
View file @
5b2fd269
<
template
>
<div
class=
"settings"
>
<van-cell-group
class=
"group-1"
>
<van-cell
title=
"用户名"
value=
"135****1234
"
/>
<van-cell
title=
"用户名"
:value=
"$userId
"
/>
<van-cell
is-link
center
title=
"头像"
@
click=
"onModefy"
>
<img
class=
"avatar-img"
...
...
@@ -46,6 +46,7 @@
</
template
>
<
script
>
import
{
getUserInfo
}
from
"@/api/user"
;
import
{
logoutToApp
}
from
"@/utils/bridgeToAppFun"
;
import
{
logout
}
from
"@/api/user"
;
import
{
fillInviteCode
}
from
"@/api/user"
;
...
...
@@ -61,7 +62,17 @@ export default {
inviteeCodeDialog
:
false
};
},
created
()
{
this
.
getUser
()
},
methods
:
{
getUser
()
{
getUserInfo
().
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
localStorage
.
setItem
(
"user"
,
JSON
.
stringify
(
res
.
data
));
}
})
},
logout
()
{
const
params
=
{
token
:
"qwedskdljlkjlklkjlkjlkjl"
...
...
This diff is collapsed.
Click to expand it.
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