家政小程序
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.

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. class CheckToken
  5. {
  6. /**
  7. * Handle an incoming request.
  8. *
  9. * @param \Illuminate\Http\Request $request
  10. * @param \Closure $next
  11. * @return mixed
  12. */
  13. public function handle($request, Closure $next)
  14. {
  15. $wechat_id = $request->header("openid");
  16. if(!$wechat_id) {
  17. return Response()->json([
  18. "status" => -1,
  19. "error" => 403,
  20. "message" => "openid不能为空,请先登陆"
  21. ]);
  22. }
  23. return $next($request);
  24. }
  25. }