在后端解决AJAX跨域问题(小记)

在响应时设置如下的header:

  • Access-Control-Allow-Origin, *
  • Access-Control-Allow-Headers, Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma,nLast-Modified, Cache-Control, Expires, Content-Type, Content-Language, Cache-Control, X-E4M-With,X_FILENAME
  • Access-Control-Allow-Methods, PUT,POST,GET,DELETE,OPTIONS

添加完即可

0%