try to make redirect work properly
This commit is contained in:
1 parent
1347796dbd
commit
f76b1fec34
2 files changed
+5
-5
No files matched your search
@@ -7,7 +7,11 @@ import { Vue, Component } from 'nuxt-property-decorator'
|
|||||||
|
|
||||||
@Component<BlogPage>({
|
@Component<BlogPage>({
|
||||||
async asyncData({ $axios }) {
|
async asyncData({ $axios }) {
|
||||||
const { result, count } = (await $axios.$get('/api/q')) || {}
|
if (process.static && typeof location !== 'undefined') {
|
||||||
|
location.reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
const { result, count } = await $axios.$get('/api/q')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
posts: result,
|
posts: result,
|
||||||
|
|||||||
@@ -19,10 +19,6 @@ const plugin: Plugin = ({ $axios, error }) => {
|
|||||||
return r
|
return r
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
if (process.static) {
|
|
||||||
return {}
|
|
||||||
}
|
|
||||||
|
|
||||||
error({
|
error({
|
||||||
statusCode: err.response.status,
|
statusCode: err.response.status,
|
||||||
message: err.toJSON(),
|
message: err.toJSON(),
|
||||||
|
|||||||
Reference in new issue
Block a user