【发布时间】:2021-03-28 08:20:54
【问题描述】:
我需要一个本地 CORS 代理来从外部源加载图像。这些图像应该在画布对象中呈现。 为此,我使用https://github.com/softius/php-cross-domain-proxy的解决方案
但是没有加载图像但有一个空响应
这是应该在画布对象中呈现图像的部分
loadImages() {
this.images.forEach((value, index) => {
const image = {};
image.img = new Image();
image.img.crossOrigin = 'anonymous';
image.img.src = 'https://cors-anywhere.herokuapp.com/' + value.packshot;
//image.img.src = '/proxy.php?csurl=' + value.packshot;
image.img.onload = (() => {
// some code
});
});
},
这不起作用 /proxy.php?csurl=http://download.falk-ross.eu/ws/picture/163_06_051_f-2015-nc_01.jpg
有人知道建议吗?
【问题讨论】: