引入qs模块

 

使用 qs模块将data序列化,再传递,注意header必须设置为

'content-type':'application/x-www-form-urlencoded',

import qs from 'qs';
  data = qs.stringify(data);
  uni.request({
    url: base_api_url + url,
    header:{
      'content-type':'application/x-www-form-urlencoded',
    },
    data: data,
    method,
    success: (res) => {
       
    }
  });

相关文章:

  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 1970-01-01
  • 2022-01-30
猜你喜欢
  • 2021-05-21
  • 2021-11-22
  • 2021-11-14
  • 2021-11-23
  • 2021-06-16
相关资源
相似解决方案