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 ,雖然報錯但是我接口可以請求成功返回數(shù)據(jù);接口地址為192.168.18.192下面是一個請求數(shù)據(jù)的一個接口
這是ajax請求
Vue axios請求服務(wù)器端跨域攜帶cookie問題
繁華開滿天機(jī)
2019-03-11 11:21:19