- ajax("/news", "GET", { cursor: this.cursor }, res => {
- if (res.newsList.length > 0) {
- this.newsList = this.newsList.concat(res.newsList);
- const L = res.newsList.length;
- if (L > 0) this.cursor = res.newsList[L - 1].id;
- } else this.hasMore = false;
- });
+ ajax(
+ "/news",
+ "GET",
+ {
+ data: { cursor: this.cursor },
+ success: (res) => {
+ if (res.newsList.length > 0) {
+ this.newsList = this.newsList.concat(res.newsList);
+ const L = res.newsList.length;
+ if (L > 0) this.cursor = res.newsList[L - 1].added;
+ } else this.hasMore = false;
+ }
+ }
+ );