After the vue axios request backend is set to allow cross-domain, what should I do if the get request becomes an options request?

what should I do when the vue axios request backend is set to allow cross-domain get requests and becomes options requests?


:


Mar.25,2021

first learn what an options request is and why there is an options request. This is a request that usually occurs when you set Cors for cross-domain operations, and it is a normal request.


this is a normal operation, and you don't need to solve it. You just need to care about whether the data has been requested.


the request header of the backend is not complete.
if I remember correctly, content-type is also added, can't you add it?
options operation is to say hello first, the basic operation is ignored, and the general framework will handle it.

update:
options request to communicate with browser to allow custom header,. There is no from, in your return. You have customized the contenttype, to be added to the post request.
clipboard.png


add a @ CrossOrigin annotation to the backend method, which seems to be the content after spring4.2, to solve cross-domain problems

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b410f2-2b2a6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b410f2-2b2a6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?