<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-08 16:22:09
 技术支持 口号帮 
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Http\Middleware;use App\Models\Member;use Closure;use Illuminate\Support\Facades\Log;use Illuminate\Support\Facades\Redis;use Illuminate\Support\Facades\Session;class CheckLogin{public function handle($request,Closure $next){$P2g0=(bool)$request->identifier;if($P2g0)goto P2gBodyx5;goto P2gNextx5;P2gBodyx5:$P2g0=(bool)$request->authentication;goto P2gx4;P2gNextx5:P2gx4:$P2g1=(bool)$P2g0;if($P2g1)goto P2gBodyx3;goto P2gNextx3;P2gBodyx3:$P2g1=(bool)Redis::get('token:'.$request->identifier);goto P2gx2;P2gNextx3:P2gx2:if($P2g1)goto P2gBodyx6;goto P2gNextx6;P2gBodyx6:$user=Member::where(['remember_token'=>$request->authentication])->first();if($user)goto P2gBodyx8;goto P2gNextx8;P2gBodyx8:$token=Redis::get('token:'.$request->identifier);$uid=json_decode($token,true)['uid'];$P2g0=$user->id==$uid;if($P2g0)goto P2gBodyxa;goto P2gNextxa;P2gBodyxa:$request->merge(['uid'=>$uid,'type'=>$user->type,]);return $next($request);goto P2gx9;P2gNextxa:$P2gAC0=array();$P2gAC0['code']=4002;$P2gAC0['info']='请登录';$P2gAC0['data']=null;return $P2gAC0;P2gx9:goto P2gx7;P2gNextx8:$P2gAC0=array();$P2gAC0['code']=4002;$P2gAC0['info']='请登录';$P2gAC0['data']=null;return $P2gAC0;P2gx7:goto P2gx1;P2gNextx6:$P2gAC0=array();$P2gAC0['code']=4001;$P2gAC0['info']='token失效';$P2gAC0['data']=null;return $P2gAC0;P2gx1:}}
?>