did
when processing OPTIONS request if (isset($_SERVER["HTTP_ORIGIN"])) {
header("Access-Control-Allow-Origin:" . $_SERVER["HTTP_ORIGIN"]);
}
header("Access-Control-Allow-Headers: SET-COOKIE,COOKIE,token,Origin, X-Requested-With, Content-Type,withCredentials");
header("Access-Control-Allow-Methods: OPTIONS,POST,GET,DELETE,PUT");
header("Access-Control-Allow-Credentials: true");
if ($request->isOptions()) {
exit;
}
but the CAPTCHA still cannot be verified successfully!
the front-end axios has also been added
axios.defaults.withCredentials = true;
both apache and nginx are the same, even if you get rid of the above code and use nginx for cross-domain processing, it will not be solved!
or is there something wrong with the way I get the CAPTCHA at the front end?
the front end uses vue to directly give the address of the CAPTCHA to img
when obtaining the CAPTCHA. <img :src="captcha" @click="getImgCaptcha">
getImgCaptcha() {
this.captcha = this.$api + "captcha?time=" + Math.random();
},