uniapp对接接口图片上传

将方法复制到你的上传位置的标签方法里就可以了
// 图片上传
uploadSpeciesPic() {

let that = this;
uni.chooseImage({
count: 1, //默认
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择
success: res => {

uni.uploadFile({
url: helper.api + '/app/company/uploadPreventionImgFile', //仅为示例,非真实的接口地址
filePath: tempFilePaths[0],
name: 'file',
fileType: 'json',
//这个是参数根据你后台的需求可以隐藏
formData: {

uniapp对接接口图片上传最先出现在Python成神之路

版权声明:
作者:admin
链接:https://www.techfm.club/p/21013.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>