From 537c37d6b0d8c78fbefc27f1323fcf86d17cef2a Mon Sep 17 00:00:00 2001 From: Devil Date: Tue, 5 Jan 2021 18:11:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=8F=92=E4=BB=B6=E4=B8=8E?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=8F=92=E4=BB=B6=E4=B8=8A=E4=BC=A0=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/PaymentService.php | 4 ++-- application/service/PluginsAdminService.php | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/application/service/PaymentService.php b/application/service/PaymentService.php index 812695fcc..557e011cd 100755 --- a/application/service/PaymentService.php +++ b/application/service/PaymentService.php @@ -541,9 +541,9 @@ class PaymentService if($success > 0) { - return DataReturn('上传成功[成功'.$success.'个, 失败'.$error.'个]', 0); + return DataReturn('上传成功[成功'.$success.'个支付插件, 失败'.$error.'个无效文件]', 0); } - return DataReturn('上传失败'.$error.'个', -10); + return DataReturn('上传失败,'.$error.'个无效文件、如功能插件请到[ 应用中心->应用管理 ]模块里面去上传安装', -10); } /** diff --git a/application/service/PluginsAdminService.php b/application/service/PluginsAdminService.php index d4c41c015..f6c0c0cdf 100755 --- a/application/service/PluginsAdminService.php +++ b/application/service/PluginsAdminService.php @@ -1061,6 +1061,15 @@ php; $plugins_name = substr($file, 0, strpos($file, '/')); if(empty($plugins_name)) { + // 应用名称为空、则校验是否为支付插件 + $file_size = zip_entry_filesize($temp_resource); + $file_content = zip_entry_read($temp_resource, $file_size); + if(stripos($file_content, 'namespace payment') !== false) + { + return DataReturn('支付插件请到[ 网站管理->支付方式 ]模块里面去上传安装', -1); + } + + // 不是支付插件则提示插件包错误 return DataReturn('插件包有误', -30); } -- GitLab