header('sign'); if(!$sign){ throw new \Exception('签名不能为空!', 500); } $token = $request->header('Authorization', ''); $data = $request->all(); $string = KsortAscll($data); $mySign = strtoupper(md5($string . $token . config('app')['sign_key'])); if($mySign != $sign) { throw new \Exception('签名错误!' . $string . $token . config('app')['sign_key'], 500); } return $handler($request); }catch (\Exception $exception){ throw new \Exception($exception->getMessage(), $exception->getCode()); } } }