i5ting / imove

INACTIVE: Move your mouse, generate code from flow chart
https://www.yuque.com/imove/docs/hvu0md
MIT License
3.75k stars 343 forks source link

关于ajax跨域问题 #100

Closed GrubbyHunter closed 2 years ago

GrubbyHunter commented 3 years ago

由于是在线的项目,我们测试的接口通常可定不是在localhost:8080下的,如果我写了一个接口全路径,然后在localhost:8080下axios发起请求就会跨

SmallStoneSK commented 3 years ago

@GrubbyHunter 你说的跨域是哪个请求?

ghost commented 3 years ago

三种解决方案:

  1. 本地开发时配置反向代理。如果说 imove 有提供这种反向代理配置,就会方便一点
  2. 针对接口放开跨域限制。
  3. 装一个 CORS 浏览器插件

话说这个问题和 imove 没啥关系吧