feat(profile): add help screen and fix upload field name
All checks were successful
Frontend CI / ota (ios) (push) Successful in 2m46s
Frontend CI / ota (android) (push) Successful in 2m50s
Frontend CI / build-and-push-web (push) Successful in 3m54s
Frontend CI / build-android-apk (push) Successful in 40m29s

Add dedicated Help screen to profile tab with navigation integration.
Refactor SettingsScreen to navigate to HelpScreen instead of showing placeholder alert.
Fix API upload method to use correct field names ("file" for documents, "image" for media)
based on endpoint path, resolving upload failures for file uploads.
This commit is contained in:
lafay
2026-06-22 07:56:06 +08:00
parent 761f315a60
commit 2bad59afbb
9 changed files with 516 additions and 99 deletions

View File

@@ -505,6 +505,10 @@ class ApiClient {
let data: ApiResponse<T>;
// 根据请求路径决定 form 字段名:
// 后端 UploadFile handler 期望字段名为 "file",其余(图片/头像/封面)为 "image"
const fieldName = path === '/uploads/files' ? 'file' : 'image';
if (Platform.OS === 'web') {
// Web 端fetch + Blob/File + FormData
const formData = new FormData();
@@ -513,7 +517,7 @@ class ApiClient {
const uploadFile = new File([blob], file.name, {
type: file.type || blob.type || 'application/octet-stream',
});
formData.append('image', uploadFile);
formData.append(fieldName, uploadFile);
if (additionalData) {
Object.keys(additionalData).forEach(key => {
@@ -534,7 +538,7 @@ class ApiClient {
const result = await fsFile.upload(`${this.baseUrl}${path}`, {
httpMethod: 'POST',
uploadType: UploadType.MULTIPART,
fieldName: 'image',
fieldName,
mimeType: file.type,
headers,
parameters: additionalData,