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:
1 parent
96c3ac3bb9
commit
02ac24ba88
5 files changed
+110
-25
No files matched your search
@@ -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 || '加载失败');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user