在vue中使用axios发送post请求,参数方式

时间:2025-02-13 08:16:58
axios({ url: '../../../room/listRoomPage', method: 'post', data: {offset: 0, limit: 9999, roomCode: "", roomtypeId: 0, floorId: 0}, transformRequest: [function (data) { var oMyForm = new FormData(); ("offset", 0); ("limit", 9999); ("roomCode", ""); ("roomtypeId", 0); ("floorId", 0); (oMyForm); return oMyForm; }], headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }) .then(function (response) { (response); }) .catch(function (error) { (error); });