修复每页数量选择功能
- 前端搜索时传递limit参数 - 后端搜索API支持limit参数
This commit is contained in:
@@ -49,7 +49,12 @@ async function loadArticles() {
|
||||
});
|
||||
|
||||
if (keyword) {
|
||||
const response = await fetch(`${API_BASE}/api/articles/search?q=${encodeURIComponent(keyword)}${category ? '&category=' + encodeURIComponent(category) : ''}`);
|
||||
// 搜索时也传递 limit 参数
|
||||
let searchUrl = `${API_BASE}/api/articles/search?q=${encodeURIComponent(keyword)}`;
|
||||
if (category) searchUrl += `&category=${encodeURIComponent(category)}`;
|
||||
searchUrl += `&limit=${pageSize}`;
|
||||
|
||||
const response = await fetch(searchUrl);
|
||||
const data = await response.json();
|
||||
|
||||
if (data.success) {
|
||||
|
||||
Reference in New Issue
Block a user