提交 537c37d6 编写于 作者: D Devil

支付插件与功能插件上传检测错误提示优化

上级 4ccc0e6f
......@@ -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);
}
/**
......
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册