作者 lackoxygen

fix:request

@@ -56,23 +56,20 @@ class Verify extends Config @@ -56,23 +56,20 @@ class Verify extends Config
56 } 56 }
57 57
58 /** 58 /**
59 - * @param Request $request 59 + * @param string $sign
  60 + * @param array $body
  61 + * @param string $signMethod
  62 + * @param string $appid
60 * @return bool|void 63 * @return bool|void
61 */ 64 */
62 - public function through(Request $request) 65 + public function through(string $sign, array $body, string $signMethod, string $appid)
63 { 66 {
64 - $signMethod = $request->getHeaderLine('sign-method');  
65 -  
66 - $eventSign = $request->getHeaderLine('event-sign');  
67 -  
68 - $appId = $request->getHeaderLine('app-id');  
69 -  
70 $configs = \config(ServiceProvider::$name); 67 $configs = \config(ServiceProvider::$name);
71 68
72 $appName = null; 69 $appName = null;
73 70
74 foreach ($configs as $name => $config) { 71 foreach ($configs as $name => $config) {
75 - if (Arr::get($config, 'app_key') === $appId) { 72 + if (Arr::get($config, 'app_key') === $appid) {
76 $appName = $name; 73 $appName = $name;
77 break; 74 break;
78 } 75 }
@@ -88,9 +85,9 @@ class Verify extends Config @@ -88,9 +85,9 @@ class Verify extends Config
88 85
89 switch ($signMethod) { 86 switch ($signMethod) {
90 case 'hmac-sha256': 87 case 'hmac-sha256':
91 - return $this->sha256($eventSign, $request->getBody()); 88 + return $this->sha256($sign, $body);
92 case 'md5': 89 case 'md5':
93 - return $this->md5($eventSign, $request->getBody()); 90 + return $this->md5($sign, $body);
94 } 91 }
95 } 92 }
96 } 93 }