The front end passes the array to the back end, with multiple same keys corresponding to different values

First, if you want to pass an array, you can follow the splicing form as follows:

&materialsTypeId=11&materialsTypeId=12&materialsTypeId=&materialsTypeId=
Features: the
same key value can appear multiple times, the
value value can be empty

Second, my case

Insert picture description here

Three, my approach

Insert picture description here
The main thing is the conversion array of this qs function.

headers: {
    
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
transformRequest: [data => Qs.stringify(data, {
    
     indices: false })],

The corresponding qs usage: https://suwu150.blog.csdn.net/article/details/78333452

Guess you like

Origin blog.csdn.net/weixin_42349568/article/details/114978644