用的ionic3,通过file插件下载模型obj和mtl资源到手机,
that.zip.unzip(that.file.dataDirectory...
然后通过three.js载入资源
this.mtlLoader.load('340.mtl', (material)=> {
console.log(material);
}
结果报了这个错
Access to XMLHttpRequest at 'file:///data/user/0/com.toysoho.ticket/340/340.mtl' from origin 'http://localhost:8080' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, https.
模型文件直接放工程里可以访问,但是通过下载的位置就没法访问了
有什么解决办法?