You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
如果是按条件查询,删除字段后当前页码大于总页码,返回的page还是错误的,应该把 if 语句中的 page 返回,要不然条件语句就是摆设。
@GetMapping("{currentPage}/{pageSize}")
public Result getPage(@PathVariable int currentPage,@PathVariable int pageSize,Book book){
IPage<Book> page = bookService.getPage(currentPage, pageSize,book);
if (currentPage > page.getPages()){
page = bookService.getPage((int)page.getPages(),pageSize,book); //删除后返回的page把条件带上(增加了book条件)
}
return new Result(true,page); //这里返回处理过的page
}
The text was updated successfully, but these errors were encountered:
如果是按条件查询,删除字段后当前页码大于总页码,返回的page还是错误的,应该把 if 语句中的 page 返回,要不然条件语句就是摆设。
The text was updated successfully, but these errors were encountered: