标签:key 服务器 media https 七牛云 href code icon 请求
POST
请求,其中 content-type
为 multipart/form-data
。uni.chooseImage({
count: 1,
sizeType: [‘original‘, ‘compressed‘], //可以指定是原图还是压缩图,默认二者都有
sourceType: [‘album‘], //从相册选择
success: res => {
console.log(res);
uni.uploadFile({
url: ‘ http://upload.qiniup.com/‘,
filePath: this.filePath.concat(res.tempFilePaths).toString(),
name: ‘file‘,
formData: {
key: Math.round(new Date() / 1000),
token: this.token
},
success: result => {
this.producImg = res.tempFiles[0].path;
console.log(result.data.key);
this.httpImg = ‘http://‘ + this.http + ‘/‘ + Math.round(new Date() / 1000);
}
});
},
fail() {
uni.showToast({
title: ‘chooseImage fail‘,
duration: 3000,
icon: ‘none‘
});
},
error: e => {
console.log(e);
}
});
标签:key 服务器 media https 七牛云 href code icon 请求
原文地址:https://www.cnblogs.com/talust/p/12916478.html