Handle invalid spec location

This commit is contained in:
斟酌 鵬兄 2023-02-01 06:56:19 +08:00
parent b2d27d2ca0
commit cec5913c15

View File

@ -61,7 +61,6 @@ class Signin extends EventEmitter
Start( action, params, handler ) Start( action, params, handler )
{ {
var request = new HttpRequest( this.conf.spec );
var _self = this; var _self = this;
if( this.spec ) if( this.spec )
@ -70,6 +69,14 @@ class Signin extends EventEmitter
} }
else else
{ {
if( !this.conf.spec )
{
var eArgs = new SignInEventArgs({ "success": false, "data": [] });
handler( this, eArgs );
return;
}
var request = new HttpRequest( this.conf.spec );
request.addListener( "RequestComplete", function( sender, e ) request.addListener( "RequestComplete", function( sender, e )
{ {
if( e.statusCode == 200 ) if( e.statusCode == 200 )