File upload for front-end and back-end data interaction

problem found

In the original text, I used post to upload files, but failed after many attempts
Back-end interface
insert image description here
Front-end writing
insert image description here

Since the picture is in the upload format, I have been trying to fail, and the post used for the interface

find the reason

Through the code analogy, I found the reason.
The upload file is upload and
post is sent. Since post and get are commonly used, upload was not used in the previous writing, which caused the upload to fail. what a stupid mistake

Solve the problem

Add the interface upload in the front-end request.js, and then use it to change the interface to upload, so that it can run normally

Guess you like

Origin blog.csdn.net/m0_69327201/article/details/129878117