Browse Source

取消限制测试

master
weigang 5 years ago
parent
commit
649b9adbb2
  1. 16
      app/Middleware/Auth/ApiMiddleware.php
  2. 2
      app/Service/v3/Implementations/PaymentService.php

16
app/Middleware/Auth/ApiMiddleware.php

@ -9,6 +9,7 @@ use App\TaskWorker\SSDBTask;
use Hashids\Hashids; use Hashids\Hashids;
use Hyperf\HttpServer\Contract\RequestInterface as HttpRequest; use Hyperf\HttpServer\Contract\RequestInterface as HttpRequest;
use Hyperf\HttpServer\Contract\ResponseInterface as HttpResponse; use Hyperf\HttpServer\Contract\ResponseInterface as HttpResponse;
use Hyperf\HttpServer\Router\Router;
use Hyperf\Utils\ApplicationContext; use Hyperf\Utils\ApplicationContext;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
@ -42,6 +43,21 @@ class ApiMiddleware implements MiddlewareInterface
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface 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);
// }
// 签名校验 // 签名校验
# 获取参数 # 获取参数

2
app/Service/v3/Implementations/PaymentService.php

@ -60,7 +60,7 @@ class PaymentService implements PaymentServiceInterface
$payMoney = bcmul((string)$orderMain->money, 100, 0); $payMoney = bcmul((string)$orderMain->money, 100, 0);
if (env('APP_ENV') != 'prod' && $orderMain->type == OrderType::ONLINE) { if (env('APP_ENV') != 'prod' && $orderMain->type == OrderType::ONLINE) {
$payMoney = 1;
// $payMoney = 1;
} }
$user = User::select('openid')->find($userId); $user = User::select('openid')->find($userId);

Loading…
Cancel
Save