修复首页公告不能正常分页问题

This commit is contained in:
fuyanbin 2019-12-18 15:54:04 +08:00 committed by koalr
parent 12cbf7fce1
commit 45da8cfddf
2 changed files with 9 additions and 7 deletions

View File

@ -13,8 +13,14 @@ export default {
params
})
},
getAnnouncementList () {
return ajax('announcement', 'get')
getAnnouncementList (offset, limit) {
let params = {
offset: offset,
limit: limit
}
return ajax('announcement', 'get', {
params
})
},
login (data) {
return ajax('login', 'post', {

View File

@ -69,12 +69,8 @@
}
},
getAnnouncementList (page = 1) {
let params = {
limit: this.limit,
offset: (page - 1) * this.limit
}
this.btnLoading = true
api.getAnnouncementList(params).then(res => {
api.getAnnouncementList((page - 1) * this.limit, this.limit).then(res => {
this.btnLoading = false
this.announcements = res.data.data.results
this.total = res.data.data.total