<template>
  <div>
    {{JSON.stringify(detail)}}
  </div>
</template>

<script>
import axios from 'axios';

export default {
	name: "index",
	data () {
		return {
			detail: {},
			title: '',
			twitterTitle: '',
			jumpUrl: ''
		}
	},

	head() {
		return {
			type: '',
			title: this.title,
			meta: [
				{
					name: 'twitter:card',
					content: 'summary_large_image'
				},
				{
					name: 'twitter:url',
					content: this.jumpUrl
				},
				{
					name: 'twitter:title',
					content: this.twitterTitle
				},
				{
					name: 'twitter:image',
					content: this.detail.postBizData.imagePath || ''
				},
				{
					name: 'twitter:image:width',
					content: '1280'
				},
				{
					name: 'twitter:image:height',
					content: '720'
				},
			]
		}
	},
  async asyncData (params) {
     let {route} = params;
		 let {data} = await axios.post('https://denettestapi.piaoquantv.com/denet/post/getDetail', {
			baseInfo: {
				token: ''
      },
			params: {
				postId: route.params.id || ''
			}
		})
		if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
			data.data.postBizData = JSON.parse(data.data.postBizData)
		}
		return {
			detail: data.data,
		}
  }
}
</script>

<style scoped>

</style>
