threejs加载纹理图跨域

threejs加载纹理图报错Failed to execute ‘texImage2D’ on ‘WebGL2RenderingContext’: The image element contains cross-origin data, and may not be loaded

            //添加平面
            addPlane() {
              var planeGeometry = new THREE.BoxGeometry(4000, 10, 4000);
             //var texture = THREE.ImageUtils.loadTexture("static/bg-white.jpg"); //加载本地纹理图
                THREE.ImageUtils.crossOrigin = '';   //处理纹理图加载跨域问题
                var texture = THREE.ImageUtils.loadTexture( this.sceneImg); //加载纹理贴图
                var material = new THREE.MeshLambertMaterial({ //贴图通过材质添加给几何体
                    map: texture, //给纹理属性map赋值
                    side: 0, //两面可见
                }); //材质对象
                this.mesh = new THREE.Mesh(planeGeometry, material); //纹理贴图网格模型对象
                this.mesh.position.set(0, -5, 0)
                this.scene.add(this.mesh)
            },

加载本地资源不会出现跨域的情况,但是使用后台返回的资源就会报错 Failed to execute ‘texImage2D’ on ‘WebGL2RenderingContext’: The image element contains cross-origin data, and may not be loaded 这个时候就加一句THREE.ImageUtils.crossOrigin = ‘’; 就可以解决了 改依赖源码什么的 就太夸张了 不建议。