antd-admin icon indicating copy to clipboard operation
antd-admin copied to clipboard

如何进行跨域请求啊?

Open encorehe opened this issue 9 years ago • 4 comments

现在的请求 是: Request URL:http://120.27.159.127:48080/backend-coach/backend/loginBackend Request Method:OPTIONS

原来的Request Method:POST 不知道在哪更改啊,麻烦提示一下 谢谢!

encorehe avatar May 04 '17 07:05 encorehe

  • 如果是CORS跨域,src/utils/config.js下有个CORS字段
  • 如果CORS,YQL都没有设置的跨域,将会使用JSONP

zuiidea avatar May 04 '17 08:05 zuiidea

a

CORS里面 怎么设置呢 ? 我看request里面 有个fetchType参数 但是改了 也不行啊 🙏 b c

encorehe avatar May 04 '17 09:05 encorehe

你先从chrome的开发者工具network里看看服务端的header里返回的response的有没有开放跨域给你。

FatFatFox avatar May 04 '17 10:05 FatFatFox

建议使用nginx反向代理

noobalex avatar May 04 '17 14:05 noobalex