default imageUrl
This commit is contained in:
parent
74fd66e153
commit
463a8f6c81
|
@ -162,8 +162,17 @@ export default {
|
|||
},
|
||||
|
||||
async asyncData ({ $axios }) {
|
||||
const { imageUrl } = await $axios.$get('/api/v1/page/about')
|
||||
return { imageUrl }
|
||||
try {
|
||||
const { imageUrl } = await $axios.$get('/api/v1/page/about')
|
||||
if (!imageUrl) {
|
||||
throw new Error('empty imageUrl')
|
||||
}
|
||||
return { imageUrl }
|
||||
} catch {
|
||||
return {
|
||||
imageUrl: '/img/default-contact.jpg'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue