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:
lezi-fun committed 2026-08-11 10:07:30 +08:00
1 parent 93be3a2880
commit aeb8adae4c
4 files changed
+78 -11

No files matched your search

+3 -4
View File
@@ -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);