antvis/G6

AddShape(imgae)遇到图像跨域报错 #5331

RealRio posted onGitHub

G6 版本

5.x

问题描述

服务器没有设置access-control-allow-origin,调用AddShape(image)传入图片的url会报跨域错误,服务端暂时不能修改响应头。如何绕过跨域限制,正确添加image类型的shape呢?

重现链接

重现步骤

1. 2.

预期行为

图片正常绘制

平台

  • 操作系统: [macOS,.]
  • 网页浏览器: [Google Chrome,
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


hi @RealRio, welcome!

posted by github-actions[bot] over 1 year ago

Hi @RealRio, Please star this repo if you find it useful! Thanks :star:! 你好 @RealRio。如果该仓库对你有用,可以 star 一下,感谢你的 :star:!

posted by github-actions[bot] over 1 year ago

你好,该问题属于前端跨域请求问题,不在 G6 的考虑范围之内。

posted by Aarebecca over 1 year ago

请问你解决了吗?我也遇到了这个问题😭。renderer默认是canvas的时候图片跨域,设置成svg就没事了,但是svg一直重复渲染

posted by muzlevy about 2 months ago

Fund this Issue

$0.00
Funded

Pull requests