The background of vue+element-ui cannot accept the parameters passed by the front end, especially when multiple objects are uploaded (for example: when passing form objects and file objects). The
original method js
export function addTemplate(data){ return request({ url:'/ pshdhx/template/add' method:'post', data:data //At this time, the front-end request passed the parameters, but the back-end did not receive anything.//Reason : the axios case is the passed data, which should be changed at this time param:data, then the backend can receive the parameters passed by the frontend }) } If the backend still cannot receive the parameters, you can also do this: params:{templateId:data.templateId,templateName:templateName...}
Vue+element-ui separates the front and back ends, the front end passes parameters, but the back end cannot receive
Guess you like
Origin blog.csdn.net/pshdhx/article/details/109115047
Ranking