上傳個人資料 img 時出現以下錯誤:
無法創建沒有有效資料 URL 或 base64 編碼資料的決議檔案
它僅在上傳幾次后才會發生,主要是在第三次左右。
它在new Parse.File(fileName, { base64 })被呼叫時發生。
我做錯了什么,我該如何解決這個問題?
public async takePicture() {
this.photo = await Camera.getPhoto({
quality: 100,
width: 256,
allowEditing: false,
resultType: CameraResultType.Base64,
})
return { ...this.photo }
}
public async uploadPicture() {
if (this.photo) {
const base64 = this.photo.base64String
// Save photo to backend
const fileName = this.accountService.getUserFirstName() Date.now() ".jpg"
try {
const parseFile = new Parse.File(fileName, { base64 })
const response = await parseFile.save()
await this.accountService.setProfilePicture(response)
} catch (err) {
console.log(err)
alert(err)
}
}
}
uj5u.com熱心網友回復:
該問題已修復,但目前僅發布為3.5.0-alpha.2版本。您使用的是舊版本3.4.3,所以問題仍然存在。
您可以 fork Parse Server 并使用 Parse JS SDK 的固定 alpha 版本使其作業,或者等到 Parse Server 發布具有固定版本的版本。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/511585.html
下一篇:帶電容器JS的警報通知
