feat: port pagination and drag-drop upload from upstream

- GET /api/posts now supports page/limit, returns {data, pagination}
- Feed: pagination controls (‹ page numbers ›), reset to page 1 on sort change
- NewPost: dashed drop zone with click/drag-drop image upload, 5MB limit
- UserProfile adapts to paginated response
This commit is contained in:
lezi-fun committed 2026-08-09 21:14:18 +08:00
1 parent 96c3ac3bb9
commit 02ac24ba88
5 files changed
+110 -25

No files matched your search

+2 -2
View File
@@ -29,8 +29,8 @@ export default function UserProfile({ username }) {
return;
}
setUser(u);
const userPosts = await API.getPosts('latest', u.id);
setPosts(userPosts || []);
const result = await API.getPosts('latest', u.id);
setPosts(result.data || []);
} catch (err) {
setError(err.message || '加载失败');
}