feat: public user profile API + settings swipe navigation
- GET /api/users/profile/:username public endpoint (no auth) for user pages, matching upstream main; UserProfile uses it (was admin /users search) - Settings page: vertical scroll-snap panels (profile/security/recovery), swipe up/down to switch smoothly; sidebar nav scrolls to panel and active highlight follows scroll position
This commit is contained in:
1 parent
fe71b03d2e
commit
0b86c54867
4 files changed
+78
-11
No files matched your search
@@ -22,10 +22,9 @@ export default function UserProfile({ username }) {
|
||||
const load = useCallback(async () => {
|
||||
setError(null);
|
||||
try {
|
||||
const users = await API.getUsersByUsername(username);
|
||||
const u = users && users.length > 0 ? users[0] : null;
|
||||
if (!u) {
|
||||
setError('用户不存在');
|
||||
const u = await API.getUserProfile(username);
|
||||
if (u.error || !u.id) {
|
||||
setError(u.error || '用户不存在');
|
||||
return;
|
||||
}
|
||||
setUser(u);
|
||||
|
||||
Reference in new issue
Block a user