Since axios sends data by default, the data format is Request Payload, not our commonly used Form Data format, and the backend may not be able to obtain it normally, so before sending, it needs to be processed by the qs module.
import qs from 'qs'; ... axios.post('url', qs.stringify({ a: '1' })) .then( ... ) .catch( ... );
Implemented using axios request interceptor
axios.interceptors.request.use(function (config) { config.data = qs.stringify(config.data); //qs处理 return config; }, function (error) { return Promise.reject(error); });