From 118dc3ac3e577f347a7a921a38823b5ecec7ebd7 Mon Sep 17 00:00:00 2001 From: Karen Date: Wed, 23 Feb 2022 15:49:37 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9C=A8apache=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E4=B8=8BCookie=EF=BC=88=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=A7=82=E7=9C=8B=E6=AC=A1=E6=95=B0=20click=5Fnum=5F=EF=BC=89?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E6=8A=A5403=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Middleware/EncryptCookies.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 033136a..978f555 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -6,12 +6,30 @@ use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; class EncryptCookies extends Middleware { + /** * The names of the cookies that should not be encrypted. * * @var array */ protected $except = [ - // + '^click_num_\d+$' ]; + + public function isDisabled($name) + { + if (in_array($name, $this->except)) + { + return true; + } + foreach ($this->except as $pattern) + { + if (preg_match("/{$pattern}/", $name)) + { + return true; + } + } + return false; + } + } -- Gitee From d0975c0bd74484dad43e4fc7dc7a864ceb8a6352 Mon Sep 17 00:00:00 2001 From: Karen Date: Wed, 23 Feb 2022 16:13:13 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9C=A8apache=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=E4=B8=8BCookie=EF=BC=88=E5=95=86=E5=93=81?= =?UTF-8?q?=E8=A7=82=E7=9C=8B=E6=AC=A1=E6=95=B0=20click=5Fnum=5F=EF=BC=89?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E6=8A=A5403=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Middleware/EncryptCookies.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php index 978f555..c81b043 100644 --- a/app/Http/Middleware/EncryptCookies.php +++ b/app/Http/Middleware/EncryptCookies.php @@ -3,6 +3,7 @@ namespace App\Http\Middleware; use Illuminate\Cookie\Middleware\EncryptCookies as Middleware; +use Illuminate\Support\Str; class EncryptCookies extends Middleware { @@ -13,7 +14,7 @@ class EncryptCookies extends Middleware * @var array */ protected $except = [ - '^click_num_\d+$' + 'click_num_*' ]; public function isDisabled($name) @@ -24,7 +25,7 @@ class EncryptCookies extends Middleware } foreach ($this->except as $pattern) { - if (preg_match("/{$pattern}/", $name)) + if (Str::is($pattern, $name)) { return true; } -- Gitee From 53aa47e1b13ef701917924310b35982dd348f85e Mon Sep 17 00:00:00 2001 From: Karen Date: Sat, 26 Feb 2022 11:46:47 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=20paypal=20=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=97=A5=E5=BF=97=20daily=20=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Payment/PaypalController.php | 8 ++++---- app/Http/Controllers/Product/ProductController.php | 10 ---------- app/Repositories/AppRepository.php | 2 +- app/Repositories/OrderRepository.php | 4 ++-- config/logging.php | 7 +++++++ 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/Payment/PaypalController.php b/app/Http/Controllers/Payment/PaypalController.php index 50802e8..bd66186 100644 --- a/app/Http/Controllers/Payment/PaypalController.php +++ b/app/Http/Controllers/Payment/PaypalController.php @@ -144,8 +144,8 @@ class PaypalController extends Controller if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal check res begin'); - Log::debug('notify data', $data); + Log::channel('paypal')->debug('paypal check res begin'); + Log::channel('paypal')->debug('notify data', $data); } $order_no = $request->post('invoice'); @@ -169,14 +169,14 @@ class PaypalController extends Controller if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal check res url:' . $url); + Log::channel('paypal')->debug('paypal check res url:' . $url); } $verifyReturn = $this->curlGet($url); if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal check res:' . $verifyReturn); + Log::channel('paypal')->debug('paypal check res:' . $verifyReturn); } if ($verifyReturn == 'VERIFIED') diff --git a/app/Http/Controllers/Product/ProductController.php b/app/Http/Controllers/Product/ProductController.php index 4c090ab..a6c312d 100644 --- a/app/Http/Controllers/Product/ProductController.php +++ b/app/Http/Controllers/Product/ProductController.php @@ -97,16 +97,6 @@ class ProductController extends Controller } else { $model->where('title', 'like', "%{$request->keywords}%"); - /* * ********************************************************************************** - ● 搜索语法规则: - + 一定要有(不含有该关键词的数据条均被忽略)。 - - 不可以有(排除指定关键词,含有该关键词的均被忽略)。 - > 提高该条匹配数据的权重值。 - < 降低该条匹配数据的权重值。 - ~ 将其相关性由正转负,表示拥有该字会降低相关性(但不像 - 将之排除),只是排在较后面权重值降低。 - * 万用字,不像其他语法放在前面,这个要接在字符串后面。 - " " 用双引号将一段句子包起来表示要完全相符,不可拆字。 - */ } } $model->select(['id', 'title', 'stock', 'stock_status', 'original_price', 'sale_price', 'img_cover', 'click_num']); diff --git a/app/Repositories/AppRepository.php b/app/Repositories/AppRepository.php index 89627df..7186853 100644 --- a/app/Repositories/AppRepository.php +++ b/app/Repositories/AppRepository.php @@ -20,7 +20,7 @@ class AppRepository /** * strongshop 系统版本 */ - const VERSION = '1.5.2'; + const VERSION = '1.5.3'; /** * uuid diff --git a/app/Repositories/OrderRepository.php b/app/Repositories/OrderRepository.php index 0df38d3..5a15da5 100644 --- a/app/Repositories/OrderRepository.php +++ b/app/Repositories/OrderRepository.php @@ -43,7 +43,7 @@ class OrderRepository { if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal notify $order_no,$transaction_id,$paid_amount: ', [$order_no, $transaction_id, $paid_amount]); + Log::debug('payment notify $order_no,$transaction_id,$paid_amount: ', [$order_no, $transaction_id, $paid_amount]); } return; } @@ -52,7 +52,7 @@ class OrderRepository { if (config('app.debug') || env('PAYMENT_LOG')) { - Log::debug('paypal notify $order_no,$transaction_id,$paid_amount:已支付 ', [$order_no, $transaction_id, $paid_amount]); + Log::debug('payment notify $order_no,$transaction_id,$paid_amount:已支付 ', [$order_no, $transaction_id, $paid_amount]); } return; } diff --git a/config/logging.php b/config/logging.php index 088c204..92f91d5 100644 --- a/config/logging.php +++ b/config/logging.php @@ -99,6 +99,13 @@ return [ 'emergency' => [ 'path' => storage_path('logs/laravel.log'), ], + + 'paypal' => [ + 'driver' => 'daily', + 'path' => storage_path('logs/payment/paypal.log'), + 'level' => 'debug', + 'days' => 14, + ], ], ]; -- Gitee From 822de56c6ae9c266517d2012178a6b9e79a23bcb Mon Sep 17 00:00:00 2001 From: Karen Date: Thu, 31 Mar 2022 10:13:33 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E5=AF=BC=E8=88=AA=E6=B7=BB=E5=8A=A0"?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E7=BC=93=E5=AD=98"=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Strongadmin/WebconfigController.php | 6 ++++++ resources/views/strongadmin/index/home.blade.php | 1 + 2 files changed, 7 insertions(+) diff --git a/app/Http/Controllers/Strongadmin/WebconfigController.php b/app/Http/Controllers/Strongadmin/WebconfigController.php index 2edb0a9..73a278b 100644 --- a/app/Http/Controllers/Strongadmin/WebconfigController.php +++ b/app/Http/Controllers/Strongadmin/WebconfigController.php @@ -74,6 +74,12 @@ class WebconfigController extends BaseController public function clearcache(Request $request, Webconfig $webconfig) { Cache::flush(); + + if (!$request->expectsJson()) + { + exit(""); + } + return [ 'code' => 200, 'message' => '清楚缓存成功', diff --git a/resources/views/strongadmin/index/home.blade.php b/resources/views/strongadmin/index/home.blade.php index 8bfe92a..d95d93e 100644 --- a/resources/views/strongadmin/index/home.blade.php +++ b/resources/views/strongadmin/index/home.blade.php @@ -34,6 +34,7 @@