问答详情
源自:4-1 Go语言-程序实体与关键字

提交代码,有个跨域的问题,怎么解决?

Access to XMLHttpRequest at 'https://program.imooc.com/api/run' from origin 'https://www.imooc.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

提问者:慕仔1199580 2022-05-17 23:17

个回答

  • weixin_慕九州1173902
    2022-05-31 23:26:56

    使用nginx进行反向代理,让浏览器感觉是访问同一个地址。