Commit 702fadd0 authored by fwz's avatar fwz

设置默认头像、用户信息清空

parent 1abe6ab9
......@@ -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,8 +164,11 @@ export default {
this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.userInfo = res.data.data
if(this.userInfo.avatar){
this.avatar = this.http.baseUrl + this.userInfo.avatar
}
}
})
},
openMsg() {
......
......@@ -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
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment