尝试从Google驱动器加载gltf模型时出现CORS错误

问题描述 投票:0回答:1

我目前正在尝试像这样从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}" />图像加载正常。

可能出什么事了?

html three.js google-drive-api cors aframe
1个回答
0
投票

我正在使用配置为允许CORS的python SimpleHTTPServer

不适用于此。

该请求正在由负责drive.google.com而不是localhost:8000的服务器处理。

© www.soinside.com 2019 - 2024. All rights reserved.