下面是我上传的代码
uni.uploadFile({
header: {
"Content-Type": "multipart/form-data",
"token": "eyJhbGciOiJITUFDU0hBMjU2IiwiaXNzIjoiYm9iaXNjb29sIiwiZXhwIjoxNTgyNjg4NzUzLCJzdWIiOiLnlq%2Fni4LnqIvluo%2FlkZgiLCJuYmYiOjE1ODI2NDU4NTMsImF1ZCI6InVzZXIiLCJpYXQiOjE1ODI2NDU1NTMsImp0aSI6Inp0Y0tNbnA4VHEiLCJzaWduYXR1cmUiOiI0YmU1YzNmYjc0MzI2NWMwZmU4NGUxYjNlYTIyM2NiODgzZWVmMmVlMTIzYTEyMGM2OTdkMGQ4NTMxYmZhYTQ3Iiwic3RhdHVzIjoxLCJkYXRhIjp7InVpZCI6MjQsIm5pY2tuYW1lIjoic3R5bGUifX0%3D"
},
method: "post",
url: 'https://seasonal.yangui.xin/upload',
filePath: tempFilePaths[0],
name: 'photo',
formData: {
"photo": tempFilePaths[0]
},
success: (uploadFileRes) => {
console.log(uploadFileRes.data);
}
});
0 个回复