Commit 2257f241 authored by Davve's avatar Davve

增加空值判断

parent 9009309a
......@@ -333,7 +333,11 @@
let rep = response.data.data
this.postForm = response.data.data
if (rep.creator.id && rep.creator.name){
this.user = rep.creator.id + ':' + rep.creator.name
}else{
this.user = ''
}
for (let i = 0; i < rep.star.length; i++) {
this.star.push(rep.star[i]['id'] + ':' + rep.star[i]['name'])
}
......
......@@ -283,7 +283,11 @@
starDetail(id).then(response => {
let rep = response.data.data.data
this.postForm = rep
if (rep.city.id && rep.city.name){
this.city = rep.city.id + ':' + rep.city.name
}else{
this.city = ''
}
}).catch(err => {
console.log(err)
})
......
......@@ -200,7 +200,6 @@
rules: {
nick_name: [{validator: validateRequire, trigger: 'blur'}],
avatar: [{validator: validateRequire, trigger: 'blur'}],
avatar: [{validator: validateRequire, trigger: 'blur'}],
},
tempRoute: {},
GenderTypeOptions: [
......
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