使用axios 发送请求,使用qs 序列化时,如果是query 参数,可以跳过这一步,直接拼接在路径中
const ids = [];
this.selectItem.forEach((item) => {
ids.push(item.id);
});
const query = qs.stringify({ ids: ids }, { indices: false });
deleteNoticeData(query).then((res) => {
if (!res.data.msg) {
this.getReceivedData();
}
});
export function deleteNoticeData(query) {
return request({
url: '/data/datamsg/delete?' + query,
method: 'post',
})
}