ChannelApiAuth.php 383 B

12345678910111213141516171819202122
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. class ChannelApiAuth
  5. {
  6. /**
  7. * 判断是否登陆.
  8. */
  9. public function handle($request, Closure $next)
  10. {
  11. $distribution_channel_id = session('ydyauth');
  12. if(!$distribution_channel_id) return response()->error('NOT_LOGIN');
  13. $response = $next($request);
  14. return $response;
  15. }
  16. }