From 82e676bad509069de49504397f9844272d2a9ed8 Mon Sep 17 00:00:00 2001 From: filesite Date: Sat, 13 Apr 2024 23:12:38 +0800 Subject: [PATCH] HeroUnion notify handler done --- themes/tajian/controller/FrontapiController.php | 16 +++++++++++++--- themes/tajian/controller/SiteController.php | 2 +- themes/tajian/views/layout/main.php | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/themes/tajian/controller/FrontapiController.php b/themes/tajian/controller/FrontapiController.php index f65f70c..e0a2fe9 100644 --- a/themes/tajian/controller/FrontapiController.php +++ b/themes/tajian/controller/FrontapiController.php @@ -312,12 +312,22 @@ eof; if (strtolower($mySign) != strtolower($sign)) { $code = 0; $err = '签名验证不通过!'; - }else { - + }else if (!empty($task_result['done'])) { //如果任务成功抓取到数据 + $saveUrlRes = $this->saveUrlShortCut($task_id, $task_result['url']); + $saveDescRes = $this->saveDescriptionFiles($task_id, $task_result); + if (!$saveUrlRes) { + $code = 0; + $err = '网址快捷方式文件保存失败!'; + }else if (!$saveDescRes) { + $code = 0; + $err = '标题文件、图片及其描述文件保存失败!'; + }else { + $msg = '视频相关文件保存完成。'; + } } } - echo 'Done'; + return $this->renderJson(compact('code', 'msg', 'err')); } } diff --git a/themes/tajian/controller/SiteController.php b/themes/tajian/controller/SiteController.php index 19bae36..22464b5 100644 --- a/themes/tajian/controller/SiteController.php +++ b/themes/tajian/controller/SiteController.php @@ -167,7 +167,7 @@ Class SiteController extends Controller { $pageTitle = '添加视频收藏'; $viewName = 'new'; - $params = compact('cateId', 'dirTree', 'scanResults', 'htmlReadme', 'tags'); + $params = compact('dirTree', 'scanResults', 'htmlReadme', 'tags'); return $this->render($viewName, $params, $pageTitle); } diff --git a/themes/tajian/views/layout/main.php b/themes/tajian/views/layout/main.php index dc1aaaa..e01bc7e 100644 --- a/themes/tajian/views/layout/main.php +++ b/themes/tajian/views/layout/main.php @@ -50,7 +50,7 @@ require_once __DIR__ . '/../../../../plugins/Html.php';
视频分类
$item) {