diff --git a/app/Controllers/AuthController.php b/app/Controllers/AuthController.php index b9ce6d054..e4e76156a 100755 --- a/app/Controllers/AuthController.php +++ b/app/Controllers/AuthController.php @@ -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)); } @@ -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)); } diff --git a/bootstrap.php b/bootstrap.php index 71600b16d..713f14a45 100755 --- a/bootstrap.php +++ b/bootstrap.php @@ -29,7 +29,7 @@ define("DEBUG",true); } -$_ENV['version'] = '3.0.0'; +$_ENV['version'] = '3.0.1'; // db config $dbConfig = [ diff --git a/views/default/auth/login.tpl b/views/default/auth/login.tpl index 34c9a7a8b..7b96388b3 100755 --- a/views/default/auth/login.tpl +++ b/views/default/auth/login.tpl @@ -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); diff --git a/views/default/auth/register.tpl b/views/default/auth/register.tpl index 486050dcc..adcdf2dd4 100755 --- a/views/default/auth/register.tpl +++ b/views/default/auth/register.tpl @@ -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);