We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"esdk-obs-browserjs": "^3.23.5"
下面是上传图片的方法:
/** * 上传文件 */ export const uploadFile = (file) => { const objectName = getRandomString(16) + "." + file.name?.split(".")[1]; // 创建ObsClient实例 const obsClient = new ObsClient(uploadObsConfig); return obsClient .putObject({ Bucket: uploadObsConfig.bucketname, // 桶名 SourceFile: file, Key: objectName, // 对象名 RequestDate: new Date(), }) .then(function (result) { if (result.CommonMsg.Status < 300) { if (result.InterfaceResult) { const url = `https://${uploadObsConfig.bucketname}.****/${objectName}`; console.log("上传成功", url); return url; } } return ""; }) .catch(function (err) { console.error("Error-->" + err); return ""; }); };
选择图片后,代码走进catch方法,报错如下:
函数入参File:
The text was updated successfully, but these errors were encountered:
仅仅依据截图内容无法判断出具体的错误原因,如果有完整的错误堆栈可以提供一下; 一般这种错误的原因在于json体未传完,或者json内容的格式不正确。
Sorry, something went wrong.
No branches or pull requests
下面是上传图片的方法:
选择图片后,代码走进catch方法,报错如下:
函数入参File:
请问是哪里出了错?帮忙看看
The text was updated successfully, but these errors were encountered: