关于分页问题
分页应该前端做还是后端做呢?是看项目大小吗?还是随意?相对来说后端容易些还是前端容易些?
你可能会有疑问,为什么游标要设计成 base64 编码的:
Requiring the cursor to be a string value promotes the use of an opaque cursor value. The javascript implementation of the Relay spec for instance uses Base64 encoded IDs as cursor values. This discourages the client from implying what value goes in this field and gives the server the ability to encode additional information within the cursor.
摘自:https://slack.engineering/evolving-api-pagination-at-slack/