20201112
This commit is contained in:
@@ -54,9 +54,14 @@ class User extends Controller {
|
||||
return json(['code'=>0,'userinfo'=>$admin_info]);
|
||||
}
|
||||
} else {//用户登录
|
||||
$where['account'] = $data['username'];
|
||||
$where['password'] = md5($data['password']);
|
||||
$user_info = $this->user_obj->where($where)->find();
|
||||
// $where['account'] = $data['username'];
|
||||
// $where['password'] = md5($data['password']);
|
||||
// $user_info = $this->user_obj->where($where)->find();
|
||||
|
||||
$user_info = $this->user_obj
|
||||
->where('account|email',$data['username'])
|
||||
->where('password', md5($data['password']))
|
||||
->find();
|
||||
if ($user_info == null) {//登陆失败
|
||||
return json(['code' => 1]);
|
||||
} else {//登陆成功
|
||||
@@ -185,8 +190,9 @@ class User extends Controller {
|
||||
if (!$this->my_checkcaptcha($data['code'], $data['random_num'])) {
|
||||
return json(['code' => 1, 'msg' => '验证码错误']);
|
||||
}
|
||||
$where['account'] = $data['username'];
|
||||
$res = $this->user_obj->where($where)->find();
|
||||
$res = $this->user_obj
|
||||
->where('account|email',$data['username'])
|
||||
->find();
|
||||
if ($res == null) {
|
||||
return json(['code' => 1, 'msg' => '查无此人']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user