default imageUrl

This commit is contained in:
ManjaroOne666 2019-02-15 11:05:14 +00:00
parent 74fd66e153
commit 463a8f6c81
1 changed files with 11 additions and 2 deletions

View File

@ -162,8 +162,17 @@ export default {
}, },
async asyncData ({ $axios }) { async asyncData ({ $axios }) {
try {
const { imageUrl } = await $axios.$get('/api/v1/page/about') const { imageUrl } = await $axios.$get('/api/v1/page/about')
if (!imageUrl) {
throw new Error('empty imageUrl')
}
return { imageUrl } return { imageUrl }
} catch {
return {
imageUrl: '/img/default-contact.jpg'
}
}
}, },
} }
</script> </script>