feat(content): add rich content rendering with @mentions and vote segments
- Add PostContentRenderer component for rendering posts/comments with segments - Add PostMentionInput component for @mention support in post/comment creation - Add VoteSegmentData and vote segment type for unified post creation API - Update post and comment services to support segments in API requests - Fix auth service to clear tokens before login/register - Improve database initialization with proper close/retry logic - Add verification check before allowing post creation - Add metro web shims for react-native-webrtc full package and requireNativeComponent - Update build config with git hash based version numbers
This commit is contained in:
@@ -149,6 +149,9 @@ class AuthService {
|
||||
|
||||
// 用户登录(只管 API + Token,DB 操作交给 authStore)
|
||||
async login(data: LoginRequest): Promise<AuthResponse> {
|
||||
await api.clearToken();
|
||||
api.resetAuthState();
|
||||
|
||||
const response = await api.post<AuthResponse>('/auth/login', data);
|
||||
|
||||
if (!response.data) {
|
||||
@@ -161,13 +164,15 @@ class AuthService {
|
||||
if (refreshToken) {
|
||||
await api.setRefreshToken(refreshToken);
|
||||
}
|
||||
api.resetAuthState();
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
||||
// 用户注册(只管 API + Token,DB 操作交给 authStore)
|
||||
async register(data: RegisterRequest): Promise<AuthResponse> {
|
||||
await api.clearToken();
|
||||
api.resetAuthState();
|
||||
|
||||
const response = await api.post<AuthResponse>('/auth/register', data);
|
||||
|
||||
if (!response.data) {
|
||||
@@ -180,7 +185,6 @@ class AuthService {
|
||||
if (refreshToken) {
|
||||
await api.setRefreshToken(refreshToken);
|
||||
}
|
||||
api.resetAuthState();
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user