|
|
@@ -77,10 +77,16 @@ export default {
|
|
|
init(){
|
|
|
//this.getLoginInfo();
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 拉取当前登录用户信息:回填生日展示,并把已有昵称写入 form.name 供输入框渲染
|
|
|
+ */
|
|
|
getLoginInfo(){
|
|
|
currentInfo().then(res=>{
|
|
|
if(res.code == 1){
|
|
|
- this.userInfo = res.data.info?res.data.info:[]
|
|
|
+ const info = res.data && res.data.info ? res.data.info : {}
|
|
|
+ this.userInfo = info
|
|
|
+ // 昵称绑定在 form.name,未赋值时输入框一直空白
|
|
|
+ this.form.name = info.name != null ? String(info.name) : ''
|
|
|
}
|
|
|
})
|
|
|
},
|