We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e73c99 commit c257babCopy full SHA for c257bab
pages/tag/_tagName.vue
@@ -24,11 +24,21 @@
24
import reachBottom from '~/mixins/reachBottom'
25
26
export default {
27
- async asyncData({ app, params }) {
+ async asyncData({ app, params, error }) {
28
// 标签详情
29
const tagInfo = await app.$api.getTagDetail({
30
tagName: encodeURIComponent(params.tagName)
31
- }).then(res => res.s === 1 ? res.d : {})
+ }).then(res => {
32
+ if (res.s === 1) {
33
+ return res.d
34
+ } else {
35
+ error({
36
+ statusCode: 404,
37
+ message: res.m
38
+ })
39
+ return {}
40
+ }
41
42
// 标签下的文章
43
const articleList = await app.$api.getTagEntry({
44
tagId: tagInfo.id,
0 commit comments