vue直接请求beego后台的路由 http://localhost:8081/role/datagrid报错

XMLHttpRequest cannot load http://localhost:8081/role/datagrid. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.

阅读 2.8k
1 个回答

跨域了,需要设置Access-Control-Allow-Origin为你的域名,或者直接为*

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题