今天项目中使用的前后端分离,前端使用Vue ,后端使用使用springbioot;

在同一台机器上调试,因为端口不一致出现错误axios Origin 'http://localhost:8080' is therefore not allowed access.

解决方案:服务器端配置跨域:

如图再springboot 的入口类 Application中做如下修改,即可:

spring boot 实现跨域访问

相关文章:

  • 2022-02-28
  • 2022-12-23
  • 2021-12-06
  • 2021-12-19
  • 2021-09-17
  • 2021-08-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2022-02-23
  • 2022-01-20
  • 2021-07-23
相关资源
相似解决方案