From 6d59293477b535ead4df0a23b2b26812abb298cb Mon Sep 17 00:00:00 2001 From: taoser Date: Fri, 23 Sep 2022 11:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E7=B1=BB=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/BaseController.php | 27 ++-- app/admin/controller/.gitignore | 2 + app/admin/controller/Addons.php | 4 +- app/admin/controller/Forum.php | 1 + app/admin/model/.gitignore | 1 + app/admin/view/.gitignore | 5 +- app/admin/view/addons/index.html | 95 ++++++----- app/admin/view/forum/tags.html | 2 +- app/admin/view/public/base.html | 2 +- app/admin/view/public/header.html | 2 +- app/admin/view/public/side_menu.html | 2 +- app/common.php | 18 +++ app/common/model/Article.php | 2 +- app/common/model/Cate.php | 25 ++- app/index/controller/Article.php | 5 +- app/install/data/taoler.sql | 41 ++--- composer.lock | 75 ++++----- public/.gitignore | 2 + public/static/admin/modules/addons.js | 3 + public/static/res/css/global.css | 152 ++++++++++++++++-- public/static/res/mods/index.js | 2 +- vendor/composer/installed.json | 87 +++++----- vendor/composer/installed.php | 40 ++--- vendor/endroid/qr-code/LICENSE | 2 +- vendor/endroid/qr-code/README.md | 4 + vendor/endroid/qr-code/assets/blackfire.png | Bin 0 -> 28753 bytes vendor/endroid/qr-code/src/Label/Label.php | 8 +- .../qr-code/src/Writer/ConsoleWriter.php | 29 ++++ .../src/Writer/Result/ConsoleResult.php | 73 +++++++++ .../endroid/qr-code/src/Writer/SvgWriter.php | 11 +- vendor/guzzlehttp/promises/CHANGELOG.md | 9 +- vendor/guzzlehttp/promises/README.md | 57 ++++--- .../guzzlehttp/promises/src/EachPromise.php | 8 - .../serializable-closure/composer.json | 7 +- .../src/Serializers/Native.php | 7 + .../src/Serializers/Signed.php | 5 +- .../src/Support/ClosureStream.php | 1 + vendor/phpmailer/phpmailer/README.md | 1 + vendor/phpmailer/phpmailer/VERSION | 2 +- .../phpmailer/language/phpmailer.lang-el.php | 41 +++-- vendor/phpmailer/phpmailer/src/PHPMailer.php | 20 ++- vendor/phpmailer/phpmailer/src/POP3.php | 2 +- vendor/phpmailer/phpmailer/src/SMTP.php | 2 +- vendor/services.php | 2 +- vendor/workerman/workerman/Events/Select.php | 26 ++- .../workerman/Protocols/Http/Request.php | 2 +- .../workerman/Protocols/Http/Session.php | 2 +- .../Http/Session/FileSessionHandler.php | 2 +- vendor/workerman/workerman/Protocols/Ws.php | 2 +- vendor/workerman/workerman/Worker.php | 12 +- vendor/workerman/workerman/composer.json | 2 +- vendor/yansongda/pay/CHANGELOG.md | 16 ++ vendor/yansongda/pay/LICENSE | 4 +- vendor/yansongda/pay/README.md | 3 +- .../pay/src/Contract/ProviderInterface.php | 4 +- vendor/yansongda/pay/src/Functions.php | 4 +- vendor/yansongda/pay/src/Pay.php | 12 +- .../pay/src/Plugin/Alipay/PreparePlugin.php | 10 +- .../Wechat/Ecommerce/Refund/ApplyPlugin.php | 3 + .../Wechat/Ecommerce/Refund/FindPlugin.php | 3 + .../Refund/FindReturnAdvancePlugin.php | 3 + .../Ecommerce/Refund/ReturnAdvancePlugin.php | 3 + .../Fund/Transfer/CreateBillReceiptPlugin.php | 3 + .../Transfer/CreateDetailReceiptPlugin.php | 3 + .../Wechat/Fund/Transfer/CreatePlugin.php | 3 + .../Fund/Transfer/DownloadReceiptPlugin.php | 3 + .../Transfer/QueryBatchDetailIdPlugin.php | 3 + .../Fund/Transfer/QueryBatchIdPlugin.php | 3 + .../Fund/Transfer/QueryBillReceiptPlugin.php | 3 + .../Transfer/QueryDetailReceiptPlugin.php | 3 + .../Transfer/QueryOutBatchDetailNoPlugin.php | 3 + .../Fund/Transfer/QueryOutBatchNoPlugin.php | 3 + .../pay/src/Plugin/Wechat/LaunchPlugin.php | 4 +- .../Wechat/Marketing/Coupon/CreatePlugin.php | 3 + .../Wechat/Marketing/Coupon/PausePlugin.php | 3 + .../Coupon/QueryCouponDetailPlugin.php | 5 +- .../Coupon/QueryStockDetailPlugin.php | 3 + .../Coupon/QueryStockItemsPlugin.php | 3 + .../Coupon/QueryStockMerchantsPlugin.php | 3 + .../Coupon/QueryStockRefundFlowPlugin.php | 3 + .../Coupon/QueryStockUseFlowPlugin.php | 3 + .../Marketing/Coupon/QueryStocksPlugin.php | 3 + .../Coupon/QueryUserCouponsPlugin.php | 3 + .../Wechat/Marketing/Coupon/RestartPlugin.php | 3 + .../Wechat/Marketing/Coupon/SendPlugin.php | 3 + .../Marketing/Coupon/SetCallbackPlugin.php | 3 + .../Wechat/Marketing/Coupon/StartPlugin.php | 3 + .../src/Plugin/Wechat/Pay/App/ClosePlugin.php | 3 + .../Wechat/Pay/App/DownloadBillPlugin.php | 3 + .../Wechat/Pay/App/FindRefundPlugin.php | 3 + .../Wechat/Pay/App/GetFlowBillPlugin.php | 3 + .../Wechat/Pay/App/GetTradeBillPlugin.php | 3 + .../Wechat/Pay/App/InvokePrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/App/PrepayPlugin.php | 3 + .../src/Plugin/Wechat/Pay/App/QueryPlugin.php | 3 + .../Plugin/Wechat/Pay/App/RefundPlugin.php | 3 + .../Wechat/Pay/Combine/AppPrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/Combine/ClosePlugin.php | 3 + .../Wechat/Pay/Combine/DownloadBillPlugin.php | 3 + .../Wechat/Pay/Combine/FindRefundPlugin.php | 3 + .../Wechat/Pay/Combine/GetFlowBillPlugin.php | 3 + .../Wechat/Pay/Combine/GetTradeBillPlugin.php | 3 + .../Wechat/Pay/Combine/H5PrepayPlugin.php | 3 + .../Pay/Combine/InvokeAppPrepayPlugin.php | 3 + .../Pay/Combine/InvokeJsapiPrepayPlugin.php | 3 + .../Pay/Combine/InvokeMiniPrepayPlugin.php | 3 + .../Wechat/Pay/Combine/JsapiPrepayPlugin.php | 3 + .../Wechat/Pay/Combine/MiniPrepayPlugin.php | 3 + .../Wechat/Pay/Combine/NativePrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/Combine/QueryPlugin.php | 3 + .../Wechat/Pay/Combine/RefundPlugin.php | 3 + .../Wechat/Pay/Common/CombinePrepayPlugin.php | 5 +- .../Plugin/Wechat/Pay/Common/RefundPlugin.php | 11 +- .../src/Plugin/Wechat/Pay/H5/ClosePlugin.php | 3 + .../Wechat/Pay/H5/DownloadBillPlugin.php | 3 + .../Plugin/Wechat/Pay/H5/FindRefundPlugin.php | 3 + .../Wechat/Pay/H5/GetFlowBillPlugin.php | 3 + .../Wechat/Pay/H5/GetTradeBillPlugin.php | 3 + .../src/Plugin/Wechat/Pay/H5/PrepayPlugin.php | 3 + .../src/Plugin/Wechat/Pay/H5/QueryPlugin.php | 3 + .../src/Plugin/Wechat/Pay/H5/RefundPlugin.php | 3 + .../Plugin/Wechat/Pay/Jsapi/ClosePlugin.php | 3 + .../Wechat/Pay/Jsapi/DownloadBillPlugin.php | 3 + .../Wechat/Pay/Jsapi/FindRefundPlugin.php | 3 + .../Wechat/Pay/Jsapi/GetFlowBillPlugin.php | 3 + .../Wechat/Pay/Jsapi/GetTradeBillPlugin.php | 3 + .../Wechat/Pay/Jsapi/InvokePrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/Jsapi/PrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/Jsapi/QueryPlugin.php | 3 + .../Plugin/Wechat/Pay/Jsapi/RefundPlugin.php | 3 + .../Plugin/Wechat/Pay/Mini/ClosePlugin.php | 3 + .../Wechat/Pay/Mini/DownloadBillPlugin.php | 3 + .../Wechat/Pay/Mini/FindRefundPlugin.php | 3 + .../Wechat/Pay/Mini/GetFlowBillPlugin.php | 3 + .../Wechat/Pay/Mini/GetTradeBillPlugin.php | 3 + .../Wechat/Pay/Mini/InvokePrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/Mini/PrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/Mini/QueryPlugin.php | 3 + .../Plugin/Wechat/Pay/Mini/RefundPlugin.php | 3 + .../Plugin/Wechat/Pay/Native/ClosePlugin.php | 3 + .../Wechat/Pay/Native/DownloadBillPlugin.php | 3 + .../Wechat/Pay/Native/FindRefundPlugin.php | 3 + .../Wechat/Pay/Native/GetFlowBillPlugin.php | 3 + .../Wechat/Pay/Native/GetTradeBillPlugin.php | 3 + .../Plugin/Wechat/Pay/Native/PrepayPlugin.php | 3 + .../Plugin/Wechat/Pay/Native/QueryPlugin.php | 3 + .../Plugin/Wechat/Pay/Native/RefundPlugin.php | 3 + .../pay/src/Provider/AbstractProvider.php | 8 +- vendor/yansongda/pay/src/Provider/Alipay.php | 20 +-- vendor/yansongda/pay/src/Provider/Wechat.php | 12 +- view/taoler/index/article/posts/detail.html | 2 +- view/taoler/index/public/base.html | 21 +-- view/taoler/index/public/footer.html | 46 ++++-- view/taoler/index/public/header.html | 56 +++---- view/taoler/index/public/user.html | 2 +- 155 files changed, 1030 insertions(+), 404 deletions(-) create mode 100644 vendor/endroid/qr-code/assets/blackfire.png create mode 100644 vendor/endroid/qr-code/src/Writer/ConsoleWriter.php create mode 100644 vendor/endroid/qr-code/src/Writer/Result/ConsoleResult.php diff --git a/app/BaseController.php b/app/BaseController.php index 68f0cd5..c18d659 100644 --- a/app/BaseController.php +++ b/app/BaseController.php @@ -488,10 +488,10 @@ abstract class BaseController return $upRes; } - //获取artcile所有图片 + //获取artcile内容所有图片,返回数组 protected function getArticleAllpic($str) { - // + //正则匹配 $pattern = "/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/"; preg_match_all($pattern,$str,$matchContent); if(isset($matchContent[1])){ @@ -505,7 +505,7 @@ abstract class BaseController } - //下载图片 + //下载远程图片 private function downloadImage($url) { $ch = curl_init(); @@ -520,7 +520,7 @@ abstract class BaseController } - //保存图片 + //把图片保存到本地 private function saveAsImage($url, $file) { $filename = pathinfo($url, PATHINFO_BASENAME); @@ -561,19 +561,18 @@ abstract class BaseController $images = $this->getArticleAllpic($content); if(count($images)) { foreach($images as $image){ - //1.网络图片 - //halt((stripos($image, Request::domain()) === false)); - if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false)) { - - //2.下载远程图片 - $newImageUrl = $this->downloadImage($image); - - $content = str_replace($image,Request::domain().$newImageUrl,$content); - + //1.带http地址的图片,2.非本站的网络图片 3.非带有?号等参数的图片 + if((stripos($image,'http') !== false) && (stripos($image, Request::domain()) === false) && (stripos($image, '?') === false)) { + // 如果图片中没有带参数或者加密可下载 + //下载远程图片(可下载) + $newImageUrl = $this->downloadImage($image); + //替换图片链接 + $content = str_replace($image,Request::domain().$newImageUrl,$content); } } + //不可下载的图片,如加密或者带有参数的图片如?type=jpeg,直接返回content } - + return $content; } diff --git a/app/admin/controller/.gitignore b/app/admin/controller/.gitignore index 7105d64..134978c 100644 --- a/app/admin/controller/.gitignore +++ b/app/admin/controller/.gitignore @@ -3,4 +3,6 @@ Version.php TimeLine.php Plugins.php App.php +AddonsMarket.php +ViewsMarket.php diff --git a/app/admin/controller/Addons.php b/app/admin/controller/Addons.php index bf3cda8..f79e009 100644 --- a/app/admin/controller/Addons.php +++ b/app/admin/controller/Addons.php @@ -5,7 +5,6 @@ use app\common\controller\AdminController; use think\facade\View; use think\facade\Db; use think\facade\Request; -use think\facade\Cache; use think\facade\Config; use app\admin\model\Addons as AddonsModel; use taoler\com\Files; @@ -75,8 +74,9 @@ class Addons extends AdminController ['field' => 'price','title'=> '价格(元)'], ['field' => 'status','title'=> '状态', 'width'=> 100], ['field' => 'install','title'=> '安装', 'width'=> 100], + ['field' => 'vers','title'=> '版本选择','exportTemplet' => "function(d, obj){console.log(obj) var td = obj.td(this.field); return td.find('select').val();}"], ['field' => 'ctime','title'=> '时间', 'width'=> 150], - ['title' => '操作', 'width'=> 150, 'align'=>'center', 'toolbar'=> '#addons-tool'] + ['title' => '操作', 'width'=> 300, 'align'=>'center', 'toolbar'=> '#addons-tool'] ]; } else { $res = ['code'=>-1,'msg'=>'未获取到服务器信息']; diff --git a/app/admin/controller/Forum.php b/app/admin/controller/Forum.php index 8a32864..73978a2 100644 --- a/app/admin/controller/Forum.php +++ b/app/admin/controller/Forum.php @@ -164,6 +164,7 @@ class Forum extends AdminController $msg = $addOrEdit ? lang('edit') : lang('add'); if(Request::isAjax()) { $data = Request::param(); + if(isset($data['id']) && $data['pid'] == $data['id']) return json(['code'=>-1,'msg'=> $msg.'不能作为自己的子类']); $list = Db::name('cate')->cache('catename')->save($data); if($list){ diff --git a/app/admin/model/.gitignore b/app/admin/model/.gitignore index 3eb333c..c1767a0 100644 --- a/app/admin/model/.gitignore +++ b/app/admin/model/.gitignore @@ -1,2 +1,3 @@ +App.php Version.php Plugins.php \ No newline at end of file diff --git a/app/admin/view/.gitignore b/app/admin/view/.gitignore index 28856ab..a06dec6 100644 --- a/app/admin/view/.gitignore +++ b/app/admin/view/.gitignore @@ -1,4 +1,7 @@ /key_auth /time_line /version -/plugins \ No newline at end of file +/plugins +/addons_market +/views_market +/app \ No newline at end of file diff --git a/app/admin/view/addons/index.html b/app/admin/view/addons/index.html index dc8a41c..7c4b75a 100644 --- a/app/admin/view/addons/index.html +++ b/app/admin/view/addons/index.html @@ -4,48 +4,54 @@
-
-
-
- 插件分类 -
-
- + + + + +
+
+
+ + + + + + - - - - -
@@ -72,7 +78,14 @@ ,table = layui.table ,form = layui.form ,upload = layui.upload; - + + form.render('select'); // 渲染所在容器内的 select 元素 + //监听版本选择 + form.on('select(versSelect)', function(obj){ + console.log(111) + layer.tips(this.value + ' ' + this.name + ':'+ obj.elem.checked, obj.othis); + }); + //事件 var active = { add: function(){ diff --git a/app/admin/view/forum/tags.html b/app/admin/view/forum/tags.html index ba21ccb..82059e1 100644 --- a/app/admin/view/forum/tags.html +++ b/app/admin/view/forum/tags.html @@ -113,7 +113,7 @@ overflow: visible; treeTable.on('tool(Article-cate-list)', function(obj){ var data = obj.data; if(obj.event === 'del'){ - layer.confirm('确定删除此分类?', function(index){ + layer.confirm('是否删除此分类及分类下内容?', function(index){ $.ajax({ type:'post', url:forumTagsDelete, diff --git a/app/admin/view/public/base.html b/app/admin/view/public/base.html index 03da6d8..d02e4ce 100644 --- a/app/admin/view/public/base.html +++ b/app/admin/view/public/base.html @@ -20,7 +20,7 @@ {block name="css"}{/block} - + {block name="body"}内容{/block} - + {if strpos($Request.SERVER.HTTP_USER_AGENT,"Html5Plus") === false} {include file="public/header" /} {/if} @@ -74,7 +69,7 @@ }).use('fly'); var element = layui.element; -{block name="script"} {/block} +{block name="script"}{/block} diff --git a/view/taoler/index/public/footer.html b/view/taoler/index/public/footer.html index f78d16f..4375ebd 100644 --- a/view/taoler/index/public/footer.html +++ b/view/taoler/index/public/footer.html @@ -1,16 +1,38 @@ -