Axios requests the same interface multiple times at the same time (with different parameters), resulting in confusion in the returned data

Update: In this case, please first check whether it is a background problem in the background. Our project finally found that it was a background problem after encountering different interface data disorder. .

During this period, the front end has been carrying the pot for a long time, crying

In the vue project, axios is used to make multiple requests to the same interface at the same time, resulting in confusion in the returned data. For example, the data returned by the first request is returned to other requests.

After trying some solutions, I personally suggest to communicate directly with the background to change the interface logic, put all the parameters in the array, and the background receives and returns all the data uniformly, and then the front-end splits and uses the data.

let param = {
  userType: typeArr, // 格式类似[1, 2, 3, 4]
  forMap: '1'
}
axiosMap.getKeyPersonGroup(param)

Guess you like

Origin blog.csdn.net/liona_koukou/article/details/82971221