vue请求参数处理

请求参数包含数组时,可用以下方法

export function functionName(data) {
  return request({
    url: '/xx/xx',
    method: 'get'/'post',
    params: data,
    paramsSerializer: function(params) {
      return Qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}

 

posted @ 2018-07-16 09:51  Ysoo  Views(1885)  Comments(0Edit  收藏  举报