123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Http\Middleware;
- use Illuminate\Http\Response;
- use Illuminate\Http\Request;
- use Closure;
- use App\Log;
- use App\Http\Controllers\Controller;
- use Illuminate\Support\Facades\Auth;
- class VerifyH5SignMiddleware
- {
- public function handle(Request $request, Closure $next)
- {
- $params = $request->all();
- if(!h5_verify_sign($params)){
- $data = Controller::returnValue(['msg' => '验签失败'], 4710);
- unset($params['sign']);
- $_sign = h5_set_sign($params);
- Log::logError('验签失败', [
- 'params' => $params,
- 'sign' => $_sign
- ], 'h5_verify_sign');
- return new Response($data);
- }
- return $next($request);
- }
- }
|