|
@@ -60,11 +60,11 @@ |
|
@@ -60,11 +60,11 @@ |
60
|
}, (results)=> {
|
60
|
}, (results)=> {
|
61
|
const result = results[0], misc = results[1];
|
61
|
const result = results[0], misc = results[1];
|
62
|
|
62
|
|
63
|
- if (result.code === 200) {
|
63
|
+ if (result && result.code === 200) {
|
64
|
this.likeCount = result.data;
|
64
|
this.likeCount = result.data;
|
65
|
}
|
65
|
}
|
66
|
|
66
|
|
67
|
- if (misc.code === 200) {
|
67
|
+ if (misc && misc.code === 200) {
|
68
|
this.isLiked = misc.data.isPraise === 'Y';
|
68
|
this.isLiked = misc.data.isPraise === 'Y';
|
69
|
}
|
69
|
}
|
70
|
});
|
70
|
});
|
|
@@ -75,9 +75,9 @@ |
|
@@ -75,9 +75,9 @@ |
75
|
}, (results)=> {
|
75
|
}, (results)=> {
|
76
|
const result = results[0], misc = results[1];
|
76
|
const result = results[0], misc = results[1];
|
77
|
|
77
|
|
78
|
- if (result.code === 200) {
|
78
|
+ if (result && result.code === 200) {
|
79
|
// TODO:
|
79
|
// TODO:
|
80
|
- } if (result.code === 403) {
|
80
|
+ } if (result && result.code === 403) {
|
81
|
// 未登录
|
81
|
// 未登录
|
82
|
yoho.goLogin('', function() {
|
82
|
yoho.goLogin('', function() {
|
83
|
this.toggleFavorite();
|
83
|
this.toggleFavorite();
|
|
@@ -86,7 +86,7 @@ |
|
@@ -86,7 +86,7 @@ |
86
|
});
|
86
|
});
|
87
|
}
|
87
|
}
|
88
|
|
88
|
|
89
|
- if (misc.code === 200) {
|
89
|
+ if (misc && misc.code === 200) {
|
90
|
this.isFavorite = misc.data.isFavor === 'Y';
|
90
|
this.isFavorite = misc.data.isFavor === 'Y';
|
91
|
}
|
91
|
}
|
92
|
});
|
92
|
});
|
|
@@ -109,7 +109,7 @@ |
|
@@ -109,7 +109,7 @@ |
109
|
},
|
109
|
},
|
110
|
created() {
|
110
|
created() {
|
111
|
$.get(`/editorial/misc_${this.id}.json`).then(result => {
|
111
|
$.get(`/editorial/misc_${this.id}.json`).then(result => {
|
112
|
- if (result.code === 200) {
|
112
|
+ if (result && result.code === 200) {
|
113
|
this.isFavorite = result.data.isFavor === 'Y';
|
113
|
this.isFavorite = result.data.isFavor === 'Y';
|
114
|
this.isLiked = result.data.isPraise === 'Y';
|
114
|
this.isLiked = result.data.isPraise === 'Y';
|
115
|
}
|
115
|
}
|