修改bug

master
ELF 5 years ago
parent 2f209494b9
commit 92ca638ff6

@ -42,7 +42,7 @@ class UserController extends BaseController
$user = json_decode(base64_decode(file_get_contents("php://input")), true); $user = json_decode(base64_decode(file_get_contents("php://input")), true);
#判断数据是否为空 #判断数据是否为空
if (empty($user)) { if (empty($user)) {
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this -> set_message(1001, "fail", "登录数据不能为空"); $this -> set_message(1001, "fail", "登录数据不能为空");
} }
@ -53,6 +53,7 @@ class UserController extends BaseController
$ip = get_client_ip(); $ip = get_client_ip();
if ($this->isBan($ip, $user['unique_code'])) { if ($this->isBan($ip, $user['unique_code'])) {
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this->set_message(1004, "fail", "设备已被禁用"); $this->set_message(1004, "fail", "设备已被禁用");
} }
@ -73,11 +74,13 @@ class UserController extends BaseController
case - 1: case - 1:
// $log['remarks'] = '用户不存在或被禁用'; // $log['remarks'] = '用户不存在或被禁用';
// log_action($log); // log_action($log);
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this -> set_message(1004, "fail", "用户不存在或被禁用"); $this -> set_message(1004, "fail", "用户不存在或被禁用");
break; break;
case - 2: case - 2:
// $log['remarks'] = '密码错误'; // $log['remarks'] = '密码错误';
// log_action($log); // log_action($log);
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this -> set_message(1005, "fail", "密码错误"); $this -> set_message(1005, "fail", "密码错误");
break; break;
default: default:
@ -120,11 +123,13 @@ class UserController extends BaseController
} else { } else {
// $log['remarks'] = '未知错误'; // $log['remarks'] = '未知错误';
// log_action($log); // log_action($log);
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this -> set_message(1028, "fail", "未知错误"); $this -> set_message(1028, "fail", "未知错误");
} }
break; break;
} }
// log_action($log); // log_action($log);
Redis::decr(Redis::KEY_LOGIN_LIMIT);
echo base64_encode(json_encode($res_msg)); echo base64_encode(json_encode($res_msg));
die; die;
@ -320,11 +325,13 @@ class UserController extends BaseController
case - 1: case - 1:
// $log['remarks'] = '扶持号被禁用'; // $log['remarks'] = '扶持号被禁用';
// log_action($log); // log_action($log);
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this -> set_message(1005, "fail", "密码错误"); $this -> set_message(1005, "fail", "密码错误");
break; break;
case - 2: case - 2:
// $log['remarks'] = '密码错误'; // $log['remarks'] = '密码错误';
// log_action($log); // log_action($log);
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this -> set_message(1005, "fail", "密码错误"); $this -> set_message(1005, "fail", "密码错误");
break; break;
default: default:
@ -455,6 +462,7 @@ class UserController extends BaseController
} else { } else {
// $log['remarks'] = '未知错误'; // $log['remarks'] = '未知错误';
// log_action($log); // log_action($log);
Redis::decr(Redis::KEY_LOGIN_LIMIT);
$this -> set_message(1028, "fail", "未知错误"); $this -> set_message(1028, "fail", "未知错误");
} }

Loading…
Cancel
Save