如何在查询字符串中向数组添加索引?
我尝试发送这样的数据:
axios.get('/myController/myAction', { params: { storeIds: [1,2,3] })
Run Code Online (Sandbox Code Playgroud)
我得到了这个网址:
http://localhost/api/myController/myAction?storeIds[]=1&storeIds[]=2&storeIds[]=3
Run Code Online (Sandbox Code Playgroud)
所以,我应该得到这个网址:
http://localhost/api/myController/myAction?storeIds[0]=1&storeIds[1]=2&storeIds[2]=3
Run Code Online (Sandbox Code Playgroud)
我应该在我的params选项中添加什么来获取此URL?