Skip to content

Commit

Permalink
lightassert无法直接退出,引起了bug,增加返回值的判断
Browse files Browse the repository at this point in the history
lightassert无法直接退出,后续代码依然执行,引起了bug,增加返回值的判断
  • Loading branch information
sxyizhiren committed Feb 26, 2014
1 parent 0d57c07 commit 5597741
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var Login=function(){
//避免再次回调
callbackFn=noop;
}
return yes;
}

//返回一个赋值完再回调的闭包函数
Expand Down Expand Up @@ -282,7 +283,7 @@ var Login=function(){
homepage={};
homepage.url=loginInfo.content.homeUrl;
accountInfo.logined=loginInfo.content.code;//用于外部判断是否登录成功
lightAssert(true === accountInfo.logined,'Password Or Captcha Not Match');
if(!lightAssert(true === accountInfo.logined,'Password Or Captcha Not Match'))return;
//Request内部处理了所有的跳转
//homepage.url是跳转前的
Request(homepage.url,requestCallback(homepage,function(){
Expand Down Expand Up @@ -337,7 +338,7 @@ var Login=function(){
token._rtk='';
}
//token获取不到会一直发不出状态
lightAssert(''!=token.requestToken && ''!=token._rtk);
if(!lightAssert(''!=token.requestToken && ''!=token._rtk,'Parse Token Fail'))return;
this();
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "renrenlogin",
"version": "0.0.5",
"version": "0.0.6",
"description": "A base module to login www.renren.com.",
"main": "lib/login.js",
"repository": {
Expand Down

0 comments on commit 5597741

Please sign in to comment.