微信小程序文件上传wx.uploadFile

微信小程序文件上传wx.uploadFile_第1张图片
网页版查看了一下负载要求是这样

  wx.uploadFile({
      url: `${wx.getStorageSync('apiUrl')}//sysFileInfo/upload?token=${wx.getStorageSync('token')}`, // 仅为示例,非真实的接口地址
      filePath: files[0].url,
      name: 'file',
      formData: {secretFlag: 'Y' },
      success: (res) => {
        const data = res.data
        console.log('res'+JSON.stringify(res))
      } 
    });

代码为这样 返回200成功 问题出现在name的值和formData的值不知道填什么

你可能感兴趣的:(微信小程序,小程序)