後臺解決跨域問題
阿新 • • 發佈:2018-11-10
//允許所有地址 response.setHeader("Access-Control-Allow-Origin", "*"); //允許的方法 response.setHeader("Access-Control-Allow-Methods", "POST, GET,PUT, OPTIONS, DELETE,OPTIONS"); //所能看到的請求頭 response.setHeader("Access-Control-Allow-Headers","Authorization,Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With"); //瀏覽器所能獲取到的請求頭 response.setHeader("Access-Control-Expose-Headers","Authorization,Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With");