xus admin
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
592 B

<?php
namespace App\Http\Middleware\Auth;
use Closure;
class CheckTradeStatus
{
/**
* Handle an incoming request.
* 交易状态检测
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$user = auth('api')->user();
if (blank($user)) return api_response()->error();
if ($user->trade_status == 0) {
return api_response()->error(0, '账号交易锁定,请联系客服');
}
return $next($request);
}
}