Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
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
Administrator
jd-vx-app
Commits
702fadd0
Commit
702fadd0
authored
May 07, 2022
by
fwz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置默认头像、用户信息清空
parent
1abe6ab9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
personal.vue
pages/personal.vue
+7
-3
userInfo.vue
pagesD/pages/personal/userInfo.vue
+4
-2
No files found.
pages/personal.vue
View file @
702fadd0
...
...
@@ -10,7 +10,8 @@
<div
class=
"ps__title"
></div>
<div
class=
"ps__info"
>
<div
class=
"info__cover"
>
<image
:src=
"avatar"
/>
<image
v-if=
"avatar"
:src=
"avatar"
/>
<image
v-else
src=
"@/static/my/my2.png"
/>
</div>
<div>
<div
class=
"info__name"
>
{{
userInfo
.
nickName
}}
</div>
...
...
@@ -111,7 +112,7 @@ export default {
}
],
//用户信息
userInfo
:
{},
userInfo
:
{
nickName
:
'默认昵称'
},
//头像
avatar
:
''
,
}
...
...
@@ -163,7 +164,10 @@ export default {
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
userInfo
=
res
.
data
.
data
this
.
avatar
=
this
.
http
.
baseUrl
+
this
.
userInfo
.
avatar
if
(
this
.
userInfo
.
avatar
){
this
.
avatar
=
this
.
http
.
baseUrl
+
this
.
userInfo
.
avatar
}
}
})
},
...
...
pagesD/pages/personal/userInfo.vue
View file @
702fadd0
...
...
@@ -66,7 +66,7 @@ export default {
disabled
:
true
,
//是否禁用
rules
:
{
name
:
"mobile"
,
//字段名 即提交给后端的字段
value
:
"
12563996933
"
,
value
:
""
,
verify
:
false
,
//是否开启校验
errMess
:
"手机号未填写"
,
//校验不通过的错误提示
},
...
...
@@ -326,7 +326,9 @@ export default {
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
userInfo
=
res
.
data
.
data
this
.
image
=
this
.
http
.
baseUrl
+
this
.
userInfo
.
avatar
if
(
this
.
userInfo
.
avatar
){
this
.
image
=
this
.
http
.
baseUrl
+
this
.
userInfo
.
avatar
}
this
.
formData
.
forEach
(
element
=>
{
if
(
element
.
label
===
'手机号'
)
{
element
.
rules
.
value
=
this
.
userInfo
.
mobile
...
...
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