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