快手分享,选择好友分享的报错
const imageUrl = this.shareConfig.imageUrl
const imagePath = await this.downloadFile(imageUrl)
console.log(imagePath)
sdkPlugin.onKwaiShareMessage({
title: this.shareConfig.title, //标题(必需)
description: this.shareConfig.title, //描述(必需)
thumbData: imagePath, //图片base64数据或图片平台原生路径(uniapp需要plus.io转换),不能超过64k(必需)
webpageUrl: "https://www.pgyer.com/uM27aLko", //链接(必需)
mediaObject: {
webpageUrl: "https://www.pgyer.com/uM27aLko",
},
state: "state" //可选
}, function(res) {
console.log(res);
if (res.errorCode == 1) { //成功
} else if (res.errorCode == -1) { //取消
} else { //失败
var errorCode = res.errorCode
}
});
其中,imagePath路径是:
/storage/emulated/0/Android/data/com.suolaike.app/apps/__UNI__EDCBD2F/doc/uniapp_temp_1725336217118/download/6663e95a-d7ed-4e0e-8875-7991f1afb9fc.jpg
运行报错的是:
{
"errorMsg": "Please set correct req params",
"state": "state",
"errorCode": -1010
}
1***@qq.com (作者)
图片检查了一下只有48kb, mediaObject已经删除了,还是一样的报错
你能帮忙看下是怎么原因导致吗?
2024-09-03 13:49