Skip to content

Commit 2e73c99

Browse files
committed
🐛 分页参数
1 parent 63cfd27 commit 2e73c99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pages/detail/_id.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default {
205205
},
206206
// 推荐文章
207207
getRecommendEntryByTagIds(){
208-
let last = this.recommendArticles.slice(-1)
208+
let last = this.recommendArticles.slice(-1)[0]
209209
let before = last ? last.rankIndex : ''
210210
this.$api.getRecommendEntryByTagIds({
211211
tagIds: this.tagIds.join('|'),

server/routes/v1/article.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ router.get('/recommendEntryByTagIds', validator({
181181
tagIds: { type: 'string', required: true },
182182
before: {
183183
type: 'string',
184-
validator: (rule, value) => Number(value),
184+
validator: (rule, value) => Number(value) > 0 || value === '',
185185
message: 'before 为number类型'
186186
}
187187
}), async (ctx, next) => {

0 commit comments

Comments
 (0)