header('appid'); $timestamp = $request->header('timestamp'); $sign = $request->header('sign'); //验证参数 if(empty($appid) || empty($timestamp) || empty($sign)){ return JsonService::fail('缺少请求头参数', [], 0); } //验证签名 $checkSign = ApiSignService::verifySign(['appid'=>$appid,'timestamp'=>$timestamp,'sign'=>$sign],env('app.app_secret')); if($checkSign['code'] == 0){ return JsonService::fail($checkSign['msg'],[],0); } return $next($request); } }