k***@163.com
k***@163.com
  • 发布:2025-06-16 15:27
  • 更新:2025-06-16 15:32
  • 阅读:160

我这边调用了uni.uploadFile方法,在我的真机调试中他的request method是get方法

分类:uni-app

uni.uploadFile({
url: ${BASEURL}resource/oss/upload,
// url: `,
filePath: tempImagePath,
name: 'file',
header: {
clientid: clientId,
Authorization: 'Bearer ' + units.token(),
'encrypt-key': encrypt(encryptBase64(aesKey))
},
success: (res) => {
console.log(res.data);

  if (res.statusCode === 200) {  
    let d = JSON.parse(res.data.replace(/\ufeff/g, '') || '{}');  
    if (d.code === 200) {  
      const { url, ossId } = d.data;  
      imgList.value.unshift(url);  
      imgIds.value.unshift(ossId);  
      lock = false;  
      uni.hideLoading();  
    }  
  }  
},  

});

2025-06-16 15:27 负责人:无 分享
已邀请:
DCloud_UNI_JBB

DCloud_UNI_JBB

你的代码是运行到什么平台的

要回复问题请先登录注册