baidu / baidu/amis

CURD 如果后端接口返回结构体中包含 page字段为null, 且perPage值小于总数据条数,将触发前端页面卡死

Open
#4,908 0 comments 0 reactions 0 assignees View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

请用一段清晰简洁的文字描述问题是什么...

#### 截图或视频:

可以的话,尽可能提供截图或视频来补充描述你的问题...

#### 如何复现(请务必完整填写下面内容):

1. 你是如何使用 amis 的?
sdk

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
最新及历史版本均存在
4. 粘贴有问题的完整 `amis schema` 代码:
```
{
"type": "page",
"body": {
"type": "crud",
"syncLocation": false,
"api": "/amis/api/mock2/sample",
"loadDataOnce": true,
"columns": [
{
"name": "id",
"label": "ID"
},
{
"name": "engine",
"label": "Rendering engine"
},
{
"name": "browser",
"label": "Browser"
},
{
"name": "platform",
"label": "Platform(s)"
},
{
"name": "version",
"label": "Engine version"
},
{
"name": "grade",
"label": "CSS grade",
"sortable": true
}
]
}
}
```

5. 操作步骤
请简单描述一下复现的操作步骤...
返回数据体中包含 page字段时, 如果page 字段为null , 且perPage 值小于 接口count字段值,前端会进入死循环,页面卡死
{"status":0,"msg":"ok","data":{"count":171,“page”:null,"rows":[ ... ... ]}}

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the provided CRUD schema and an API response where data.page is null, data.count is 171, and perPage is smaller than the count. Start by tracing the CRUD pagination handling, then verify that the page no longer enters an infinite loop while normal pagination still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.