我目前正在尝试像这样从Google云端硬盘将gltf模型加载到我的Aframe场景中:
<a-entity gltf-model="url(https://drive.google.com/uc?export=view&id={redacted})"></a-entity>
但是我收到以下错误:
Access to XMLHttpRequest at 'https://drive.google.com/uc?export=view&id={redacted}' from origin 'http://localhost:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
我正在使用配置为允许来自此处的CORS的python SimpleHTTPServer:https://gist.github.com/mkows/cd2122f427ea722bf41aa169ef762001
[当我将图像上传到Google驱动器并尝试使用加载该图像时<img src="https://drive.google.com/uc?export=view&id={redacted}" />
图像加载正常。
可能出什么事了?
我正在使用配置为允许CORS的python SimpleHTTPServer
不适用于此。
该请求正在由负责drive.google.com
而不是localhost:8000
的服务器处理。