这篇文章上次修改于 816 天前,可能其部分内容已经发生变化,如有疑问可询问作者。
报错:
Access to XMLHttpRequest at 'http://10.10.10.10:3019/sudt-issuer/api/v1' from origin 'http://localhost:5003/' 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 库
https://expressjs.com/en/resources/middleware/cors.html
没有评论