From 5b3927474aaafd48a7ec17ae3e439893dd0fde85 Mon Sep 17 00:00:00 2001 From: tping Date: Wed, 29 Jul 2020 14:24:39 +0800 Subject: [PATCH] =?UTF-8?q?wx=20=E5=B9=B6=E5=8F=91=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Callback/Controller/NotifyController.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Application/Callback/Controller/NotifyController.class.php b/Application/Callback/Controller/NotifyController.class.php index 86e4231e..08979776 100644 --- a/Application/Callback/Controller/NotifyController.class.php +++ b/Application/Callback/Controller/NotifyController.class.php @@ -7,6 +7,7 @@ use Org\SwiftpassSDK\Swiftpass; use Think\Log; use Qiniu\json_decode; use Sdk\Controller\Ipa365Controller; +use Base\Tool\Redis; /** @@ -278,6 +279,15 @@ class NotifyController extends BaseController public function wxpay_callback() { + Log::write("timeout".time(), Log::DEBUG); + $key = "sdk:paycallback_wx"; + $ret = Redis::get($key); + if ($ret) { + Log::write("sdk:paycallback_wx 请求太频繁", Log::DEBUG); + exit(); + } + Redis::set($key, 1, 3); // 3秒钟收一次请求 + $values = array(); Vendor("WxPayPubHelper.WxPayPubHelper"); $weixin = A("WeiXin", "Event");