提交 9d945e11 编写于 作者: K Karim Beyrouti 提交者: Mr.doob

Added `setWithCredentials` function to: ImageLoader, and TextureLoader which...

Added `setWithCredentials` function to: ImageLoader, and TextureLoader which send the `withCredentials` variable to the XHRLoader. (#9391)
上级 bd3062fa
......@@ -37,6 +37,7 @@ Object.assign( ImageLoader.prototype, {
var loader = new XHRLoader();
loader.setPath( this.path );
loader.setResponseType( 'blob' );
loader.setWithCredentials( this.withCredentials );
loader.load( url, function ( blob ) {
image.src = URL.createObjectURL( blob );
......@@ -58,6 +59,13 @@ Object.assign( ImageLoader.prototype, {
},
setWithCredentials: function ( value ) {
this.withCredentials = value;
return this;
},
setPath: function ( value ) {
this.path = value;
......
......@@ -21,6 +21,7 @@ Object.assign( TextureLoader.prototype, {
var loader = new ImageLoader( this.manager );
loader.setCrossOrigin( this.crossOrigin );
loader.setWithCredentials( this.withCredentials );
loader.setPath( this.path );
loader.load( url, function ( image ) {
......@@ -50,6 +51,13 @@ Object.assign( TextureLoader.prototype, {
},
setWithCredentials: function ( value ) {
this.withCredentials = value;
return this;
},
setPath: function ( value ) {
this.path = value;
......@@ -57,6 +65,8 @@ Object.assign( TextureLoader.prototype, {
}
} );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册