gin 练手项目

putyy · · 4248 次点击
问下楼主,跨域问题怎么解决的, 启动后台,然后npm run dev, http://127.0.0.1:5173/login 输入用户‘密码后,有如下错误: Access to XMLHttpRequest at 'http://localhost:9501/admin/login?username=admin&password=admin123' from origin 'http://127.0.0.1:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. 用官方的cors没解决这个问题,楼主是怎么解决的,谢谢。我刚学go。
#5
更多评论
jikeytang
大风起兮云飞扬,威加海内兮归故乡
厉害了,大佬。
#1
习惯了写java,感觉写gin好变扭一点都不习惯
#2