mirror of
https://github.com/QingdaoU/OnlineJudgeFE.git
synced 2024-12-28 07:21:50 +00:00
修复首页公告不能正常分页问题
This commit is contained in:
parent
12cbf7fce1
commit
45da8cfddf
@ -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', {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user