Commit eae26344 by 杨昕

添加第三方验证

parent 624b58b7
Pipeline #9902 passed with stages
in 33 seconds
......@@ -38,9 +38,10 @@ class LoginController extends Controller
}
$user = DB::connection('mongodb') //选择使用mongodb
->collection('users')->where('name',$request->name)->first();
->collection('users')->where('name',$request->name)->where('user_type',1)->first();
if ($user){
if ($user['password'] == md5($request->password)){
$result = true;
}else{
......@@ -51,6 +52,11 @@ class LoginController extends Controller
return error('用户验证失败');
}
if ($user['status']){
return error('用户已被限制,请联系管理员');
}
$id = ($user['_id'])->jsonSerialize();
$user['_id'] = $id['$oid'];
......
......@@ -162,9 +162,9 @@ class MemberController extends Controller
* @throws ControllerException
* @throws \App\Exceptions\FormException
*/
public function disable(Request $request,$id)
public function disable(Request $request)
{
$id = $request->id;
if (!$this->checkOwnHandle($id)) {
throw new \App\Exceptions\FormException('你不能操作别人的');
}
......
......@@ -76,7 +76,7 @@ class MediaModel extends Eloquent
$aggregate[]['$match']['end_time'] = ['$lt' => $request->end_time ];
}
$aggregate[]['$sort'] = ['create_time' => $sort];
$aggregate[]['$sort'] = ['start_time' => $sort];
$count = sizeof($collection->aggregate($aggregate)->toArray());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment