收藏
回答

OPPO R9使用wx.uploadFile接口参数丢失?

API名称:wx.uploadFile

设备信息:

System: Android 5.1, WeChat 8.0.19.2080

Network: wifi

UA: Mozilla/5.0 (Linux; Android 5.1; OPPO R9tm Build/LMY47I; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/3211 MMWEBSDK/20220105 Mobile Safari/537.36 MMWEBID/2615 MicroMessenger/8.0.19.2080(0x28001377) Process/appbrand0 WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android

WeChatLib2.23.4 (2022.5.16 20:18:05)

Subpackages: N/A

LazyCodeLoading: false

Launch Time: 8768 ms

我的代码:

wx.uploadFile({
          filePath: path,
          name: 'img',
          url: `${base_url.sq}/index/Image/upload2`,
          header: {
            "Content-Type""multipart/form-data",
            "accept""application/json"
          },
          success: res => {
            let data = JSON.parse(res.data);
            if (data.code === 2000) {
              resolve({
                iddata.data.image_id,
                pathdata.data.path
              });
            } else {
              reject({
                error: data.msg
              });
            }
          },
          fail: err => {
            reject({
              error: err
            })
          }
        })
回答关注问题邀请回答
收藏

2 个回答

  • Mr.Zhao
    Mr.Zhao
    2022-05-17

    不要设置content-type 容易出问题

    2022-05-17
    有用 1
    回复 1
    • tada
      tada
      2022-05-17
      真的是这个问题,感谢
      2022-05-17
      回复
  • 谢世彬
    谢世彬
    发表于移动端
    2022-05-17
    斗%∵丶丶丶丶l〈
    2022-05-17
    有用
    回复
登录 后发表内容