the server can only receive the first pre-request (options)
cannot receive the second get or post request
this is the CORS processing code
No problem on PC
the server can only receive the first pre-request (options)
cannot receive the second get or post request
this is the CORS processing code
No problem on PC
make sure that the request has been sent but has not been received by the backend;
or no request has been made at all.
$_ GET
or $_ POST
directly on the first line of the method body to see if there is any data is your client's request initiated through https?
if yes, Acess-Control-Allow-Origin
cannot be set to *. You try to use the following configuration:
if(isset($_SERVER['HTTP_ORIGIN'])){
header('Access-Control-Allow-Origin:' . $_SERVER['HTTP_ORIGIN']);
}
header('Access-Control-Allow-Credentials:true');
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'OPTIONS'){
header('Content-Length:0');
header('Content-Type:text/plain');
header('Access-Control-Max-Age:86400');
header('Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept, Authorization');
exit;
}
may also be a cache problem
Previous: How does vue traverse the array?
Next: If the width of the parent element is variable, how are multiple child elements evenly distributed?