feat(navigation): add profile stack navigator and fix API endpoints

- Add ProfileStackNavigatorComponent with full navigation stack (Profile, Settings, EditProfile, AccountSecurity, MyPosts, Bookmarks, NotificationSettings, BlockedUsers)
- Add null checks for response data in authService login, register, and refreshToken methods
- Fix postService API routes to use correct endpoints (/posts instead of /posts/cursor)
- Remove completed cursor pagination design document
This commit is contained in:
lafay
2026-03-21 01:36:40 +08:00
parent 8a0aea1c59
commit 97c7762f2b
5 changed files with 118 additions and 1153 deletions

View File

@@ -150,6 +150,9 @@ class AuthService {
async login(data: LoginRequest): Promise<AuthResponse> {
const response = await api.post<AuthResponse>('/auth/login', data);
if (!response.data) {
throw new Error('登录响应数据为空');
}
if (response.data.token) {
await api.setToken(response.data.token);
}
@@ -165,6 +168,9 @@ class AuthService {
async register(data: RegisterRequest): Promise<AuthResponse> {
const response = await api.post<AuthResponse>('/auth/register', data);
if (!response.data) {
throw new Error('注册响应数据为空');
}
if (response.data.token) {
await api.setToken(response.data.token);
}
@@ -233,6 +239,9 @@ class AuthService {
try {
const response = await api.post<RefreshTokenResponse>('/auth/refresh');
if (!response.data) {
return null;
}
if (response.data.token) {
await api.setToken(response.data.token);
}