只要將wx.request的header中改為 ‘content-type’: ‘application/x-www-form-urlencoded’ 請求參數自然就變成了form-data形式

wx.request({ url: 'test.php', //僅為示例,並非真實的接口地址 data: { x: '', y: '' }, header: { 'content-type': 'application/x-www-form-urlencoded' //修改此處即可 }, success (res) { console.log(res.data) } })

內容搬運來源:https://blog.csdn.net/weixin_44777433/article/details/103277495?spm=1001.2014.3001.5501
!!親測有效
