upload
All checks were successful
Deploy to Server / deploy (push) Successful in 14s

This commit is contained in:
jeremygan2021
2026-03-22 22:10:21 +08:00
parent 2104e7b7dc
commit 94333b61b6
3 changed files with 58 additions and 19 deletions

View File

@@ -94,10 +94,14 @@ export const uploadProjectFile = (filePath: string, projectId: number, fileName?
'Authorization': `Bearer ${Taro.getStorageSync('token')}`
}
}).then(res => {
console.log('Upload response:', res)
if (res.statusCode >= 200 && res.statusCode < 300) {
return JSON.parse(res.data)
const data = JSON.parse(res.data)
console.log('Upload success, data:', data)
return data
}
throw new Error('Upload failed')
console.error('Upload failed:', res)
throw new Error(`Upload failed: ${res.statusCode}`)
})
}