目标参数格式
http://localhost:8080/customer/getAllStore?platformCodes=JD&platformCodes=TM
参数示例
let arr =['JD','TM']
如果直接传数组的get请求地址就会是
http://localhost:8080/customer/getAllStore?0=JD&1=TM
解决方法:用paramsSerializer解决
export const getAllStore = (params) => {
return server.request({
url: '/customer/getAllStore',
method: 'get',
params,
paramsSerializer: function (params) {
const url = params.map(_ => `platformCodes=${_}`).join('&');
return `${url}`;
}
})
}