企微短剧业务系统

VerifyH5SignMiddleware.php 656B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Illuminate\Http\Response;
  4. use Illuminate\Http\Request;
  5. use Closure;
  6. use App\Log;
  7. use App\Http\Controllers\Controller;
  8. use Illuminate\Support\Facades\Auth;
  9. class VerifyH5SignMiddleware
  10. {
  11. public function handle(Request $request, Closure $next)
  12. {
  13. $params = $request->all();
  14. if(!h5_verify_sign($params)){
  15. $data = Controller::returnValue(['msg' => '验签失败'], 4710);
  16. Log::logError('验签失败', [
  17. 'params' => $params
  18. ], 'h5_verify_sign');
  19. return new Response($data);
  20. }
  21. return $next($request);
  22. }
  23. }