This commit is contained in:
@@ -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}`)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user