netlify is more reliable

This commit is contained in:
Pacharapol Withayasakpunt committed 2019-12-25 13:30:54 +07:00
1 parent 7fe8f5d154
commit 4dfff986d4
16 files changed
+42 -105

No files matched your search

+3 -8
View File
@@ -6,9 +6,8 @@ post-full(:header="header")
import { Vue, Component } from 'nuxt-property-decorator'
import PostFull from '@/components/PostFull.vue'
import htmlToText from 'html-to-text'
import { apiHash } from '@/assets/util'
import { apiHash, HASH } from '@/assets/util'
import MakeHtml from '@/assets/make-html'
import { globalStore } from '../../store'
@Component({
components: {
@@ -19,11 +18,7 @@ export default class PostPage extends Vue {
header: any = {}
async asyncData ({ params, error, redirect }: any) {
// if(process.static && process.client && $payloadURL) {
// return await $axios.$get($payloadURL(route))
// }
const ps: any[] = JSON.parse(await apiHash('/build/header/posts.json', globalStore.hash.posts._header))
const ps: any[] = JSON.parse(await apiHash('/build/header/posts.json', HASH.posts._header))
const header = ps.filter((p) => p.name === params.name)[0]
if (!header) {
@@ -34,7 +29,7 @@ export default class PostPage extends Vue {
return redirect(encodeURI(`/post/${header.y}/${header.mo}/${params.name}`))
}
header.teaser = await apiHash(`/build/teaser/${header.path}`, globalStore.hash.posts[header.path])
header.teaser = await apiHash(`/build/teaser/${header.path}`, HASH.posts[header.path])
return {
header,