<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\App\OpenApi\Middleware; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Session; use Illuminate\Support\Str; use ModStart\Core\Input\Response; use ModStart\Core\Util\SignUtil; abstract class AbstractKeySecretSimpleSignCheckMiddleware { protected abstract function getSecretByKey($HQKqq); public function handle($gSoa2, \Closure $dHcaF) { goto UWA8U; kXb9A: return $dHcaF($gSoa2); goto XXEOB; YAP7w: $FvLkj = Route::currentRouteAction(); goto ftk1c; FGFiK: $B0q5s = Input::get('timestamp'); goto rsClB; SnL8S: if (isset($P7rVp[0])) { $dOEbK = $P7rVp[0]; } else { $dOEbK = null; } goto VwTBC; KepcN: $tGCeC = SignUtil::common($dUOod, $Jxb45); goto HC34R; IRjxQ: $Jxb45 = $this->getSecretByKey($HQKqq); goto qxdCZ; H1jwh: if (($B0q5s < time() - 1800 || $B0q5s > time() + 1800) && empty($aabst['isDemo'])) { return Response::json(-1, 'timestamp not valid (' . time() . ')'); } goto qHpqH; VwTBC: if (isset($P7rVp[1])) { $FXT7G = $P7rVp[1]; } else { $FXT7G = null; } goto sz50l; cozNO: if (empty($HQKqq)) { return Response::json(-1, 'key empty'); } goto IRjxQ; gxW3h: if (empty($B0q5s)) { return Response::json(-1, 'timestamp empty'); } goto H1jwh; W_KfL: Session::flash('_openApiKey', $HQKqq); goto ol91G; DQQHg: $dUOod = array('timestamp' => $B0q5s, 'key' => $HQKqq); goto KepcN; ol91G: Session::flash('_openApiSecret', $Jxb45); goto kXb9A; rsClB: $HQKqq = Input::get('key'); goto cozNO; HC34R: if ($H8a6_ != $tGCeC) { goto s33mC; s33mC: Log::info('MS.SignNotMatch : ' . $tGCeC); goto Ge12J; jAMe2: if ($N2Xaa['code']) { return $N2Xaa['data']; } goto GV0Tm; Ge12J: $N2Xaa = $this->signNotMatch(); goto jAMe2; GV0Tm: } goto YAP7w; ftk1c: $P7rVp = explode('@', $FvLkj); goto SnL8S; qHpqH: if (empty($H8a6_)) { return Response::json(-1, 'sign empty'); } goto DQQHg; sz50l: if (!Str::startsWith($dOEbK, '\\')) { $dOEbK = '\\' . $dOEbK; } goto W_KfL; qxdCZ: if (empty($Jxb45)) { return Response::json(-1, 'invalid key'); } goto gxW3h; UWA8U: $H8a6_ = Input::get('sign'); goto FGFiK; XXEOB: } protected function signNotMatch() { return Response::generate(-1, 'sign error', Response::json(-1, 'sign error')); } }