From 649b9adbb28a1a72436decf37f9c5d73f3b58caf Mon Sep 17 00:00:00 2001 From: weigang Date: Fri, 18 Sep 2020 17:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E9=99=90=E5=88=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Middleware/Auth/ApiMiddleware.php | 16 ++++++++++++++++ .../v3/Implementations/PaymentService.php | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Middleware/Auth/ApiMiddleware.php b/app/Middleware/Auth/ApiMiddleware.php index 271d20c..f419fa6 100644 --- a/app/Middleware/Auth/ApiMiddleware.php +++ b/app/Middleware/Auth/ApiMiddleware.php @@ -9,6 +9,7 @@ use App\TaskWorker\SSDBTask; use Hashids\Hashids; use Hyperf\HttpServer\Contract\RequestInterface as HttpRequest; use Hyperf\HttpServer\Contract\ResponseInterface as HttpResponse; +use Hyperf\HttpServer\Router\Router; use Hyperf\Utils\ApplicationContext; use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; @@ -42,6 +43,21 @@ class ApiMiddleware implements MiddlewareInterface public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { + + // 拦截v1路由 + // $routePath = $this->request->getPathInfo(); + // $routePath = explode('/', $routePath); + // if ($routePath[1] == 'v1') { + // $content = [ + // "status" => 'ok', + // "code" => 99999, + // "result" => [], + // "message" => '服务已停止升级,稍后请升级更新小程序(如不能自动更新,请删除小程序后重新进入小程序)' + // ]; + // + // return $this->response->json($content); + // } + // 签名校验 # 获取参数 diff --git a/app/Service/v3/Implementations/PaymentService.php b/app/Service/v3/Implementations/PaymentService.php index b94e236..68b33a7 100644 --- a/app/Service/v3/Implementations/PaymentService.php +++ b/app/Service/v3/Implementations/PaymentService.php @@ -60,7 +60,7 @@ class PaymentService implements PaymentServiceInterface $payMoney = bcmul((string)$orderMain->money, 100, 0); if (env('APP_ENV') != 'prod' && $orderMain->type == OrderType::ONLINE) { - $payMoney = 1; + // $payMoney = 1; } $user = User::select('openid')->find($userId);