Based on the code snippet provided, it seems like you are trying to send a POST request to a server with some parameters. The buildAndFloor and oldManTrack variables are being used to create the request payload.

The oldManTrackList variable is an object array that you want to send as a parameter in the POST request. However, in the current code, you are not assigning any value to the oldManTrackList variable. Therefore, when you pass it as a parameter in the data.append() method, it will be undefined.

To fix this issue, you need to assign a value to the oldManTrackList variable before using it in the POST request. You can assign the object array to it like this:

let oldManTrackList = [ /* your object array */ ];

Then, you can update the code as follows:

let self = this;
console.log(value);
let buildAndFloor = value[1];
let oldManTrackList = self.oldManTrackList; // Assign the object array to the variable
let data = new URLSearchParams();
data.append('buildAndFloor', buildAndFloor);
data.append('oldManTrack', JSON.stringify(oldManTrackList)); // Convert the object array to a JSON string
console.log("post 传参: ", data);
self.$ajax.post(self.$baseUrl+'/open/api/location/filter', data).then(res => {
  // Handle the response
});

By using JSON.stringify() on the oldManTrackList variable, you can convert the object array to a JSON string before sending it in the POST request. The server should be able to receive and parse this JSON string back into an object array

let self = this; consolelogvalue; let buildAndFloor = value1; let oldManTrack = selfoldManTrackList; let data = new URLSearchParams; dataappendbuildAndFloorbuildAndFloor;

原文地址: http://www.cveoy.top/t/topic/iDhU 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录