The problem of Vue axios request server carrying cookie across domains

axios.defaults.withCredentials = true;

clipboard.png

php
header("Access-Control-Allow-Origin: http://localhost:8080");
header("Access-Control-Allow-Headers: Content-Type,Access-Token");
header("Access-Control-Allow-Credentials: true");

vue uiivew-admin ;192.168.18.192

clipboard.png

clipboard.png

ajax

clipboard.png

Mar.28,2021

can't see the code, so guess. You have a cross-domain error requesting github:

  • comment out the global axios.default.withCredentials = true
  • add withCredentials = true when requesting your server (method.php)

as mentioned above, configuring a update iview method in the global configuration that carries cookie causes a update iview method in the uilt.js file to request the error caused by gitgub, comment out the global, or comment out the update method of iview.

Menu