账号密码登录
This commit is contained in:
@@ -295,17 +295,35 @@ class Login extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (md5($password) != $user_info['password']) {
|
if (md5($password) != $user_info['password']) {
|
||||||
|
$data = [
|
||||||
|
'mobile' => $user_name,
|
||||||
|
'type' => 2,
|
||||||
|
'sms' => $password,
|
||||||
|
'createtime'=> time(),
|
||||||
|
];
|
||||||
|
db::name('sms_error')->insert($data);
|
||||||
return ['code' => 0, 'msg' => '密码错误', 'data' => null];
|
return ['code' => 0, 'msg' => '密码错误', 'data' => null];
|
||||||
}
|
}
|
||||||
// $multi_user = [];
|
|
||||||
// //查询手机号绑定的账号
|
//今天误次数
|
||||||
// $phone_user = $this->phone_login_query($user_name);
|
$sms_count = db::name('sms_error')->where(['mobile' => $user_name,'createtime' => ['between', [strtotime(date('Y-m-d')), time()]]])->count();
|
||||||
// if($phone_user['code'] == 1){
|
if ($sms_count >= 5) {
|
||||||
// //获取返回数据的长度
|
$user_id = db::name('user')->where('mobile', $user_name)->value('id');
|
||||||
// if(count($phone_user['data']) >= 2){
|
$block_num = db::name('block')->where(['type' => 1, 'type_text' => $user_id])->find();
|
||||||
// $multi_user = $phone_user['data'];
|
if(!$block_num){
|
||||||
// }
|
//封禁账号
|
||||||
// }
|
$error_data = [
|
||||||
|
'type' => 1,
|
||||||
|
'type_text' => $user_id,
|
||||||
|
'block_time' => time() + 60 * 60 * 24,
|
||||||
|
'block_note' => '账号登录异常被封禁24小时',
|
||||||
|
'createtime'=> time(),
|
||||||
|
];
|
||||||
|
db::name('block')->insert($error_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['code' => 0, 'msg' => '登录错误次数过多,账号已被封禁,请联系管理员处理','data' =>null];
|
||||||
|
}
|
||||||
|
|
||||||
$login = $this->login($user_info,$system,$login_device);
|
$login = $this->login($user_info,$system,$login_device);
|
||||||
if($login['code'] != 1){
|
if($login['code'] != 1){
|
||||||
|
|||||||
Reference in New Issue
Block a user