Skip to content

Commit

Permalink
fix #308
Browse files Browse the repository at this point in the history
  • Loading branch information
orvice committed Jan 22, 2016
1 parent d12249f commit 6ba1705
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function loginHandle($request, $response, $next)
}

if ($user->pass != Hash::passwordHash($passwd)){
$rs['code'] = '0';
$rs['ret'] = '0';
$rs['msg'] = "402 邮箱或者密码错误";
return $response->getBody()->write(json_encode($rs));
}
Expand All @@ -54,7 +54,7 @@ public function loginHandle($request, $response, $next)
}
Auth::login($user->id,$time);
$rs['code'] = '1';
$rs['ok'] = '1';
$rs['ret'] = '1';
$rs['msg'] = "欢迎回来";
return $response->getBody()->write(json_encode($rs));
}
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
define("DEBUG",true);
}

$_ENV['version'] = '3.0.0';
$_ENV['version'] = '3.0.1';

// db config
$dbConfig = [
Expand Down
2 changes: 1 addition & 1 deletion views/default/auth/login.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
remember_me: $("#remember_me").val()
},
success:function(data){
if(data.ok){
if(data.ret){
$("#msg-error").hide(100);
$("#msg-success").show(100);
$("#msg-success-p").html(data.msg);
Expand Down
4 changes: 2 additions & 2 deletions views/default/auth/register.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
agree: $("#agree").val()
},
success:function(data){
if(data.ok){
if(data.ret){
$("#msg-error").hide(10);
$("#msg-success").show(100);
$("#msg-success-p").html(data.msg);
window.setTimeout("location.href='login.php'", 2000);
window.setTimeout("location.href='/auth/login'", 2000);
}else{
$("#msg-error").hide(10);
$("#msg-error").show(100);
Expand Down

0 comments on commit 6ba1705

Please sign in to comment.