axios.defaults.withCredentials = true;
配置如图所示
后端为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 ui组件是ivew-admin ,虽然报错但是我接口可以请求成功返回数据;接口地址为192.168.18.192
下面是一个请求数据的一个接口
这是ajax请求
繁花不似锦
智慧大石