From d64c00a713d5db3d9aa7e5e90ce173e17b359fe7 Mon Sep 17 00:00:00 2001 From: filesite Date: Fri, 8 Dec 2023 22:13:14 +0800 Subject: [PATCH] bug fix, no tag parameter when call addfav api --- themes/tajian/views/site/index.php | 7 +++++-- www/js/tajian.js | 23 ++--------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/themes/tajian/views/site/index.php b/themes/tajian/views/site/index.php index 37392cc..0c0949f 100644 --- a/themes/tajian/views/site/index.php +++ b/themes/tajian/views/site/index.php @@ -44,7 +44,7 @@ eof; if (!empty($category['files'])) { //一级目录支持,目录下直接存放视频文件 $cate_files = Html::sortFilesByCreateTime($category['files'], 'desc'); //按创建时间排序 - foreach($cate_files as $file) { + foreach($cate_files as $index => $file) { //跳过非.url文件 if (!in_array($file['extension'], $videoExts) || empty($file['shortcut'])) { continue; @@ -57,11 +57,14 @@ eof; $pubDate = date('m/d', $file['fstat']['ctime']); + $imgSrc = $index < 8 ? " src=\"{$snapshot}\"" : ''; + $imgAlt = $index < 8 ? " alt=\"{$title}\"" : ''; + echo <<
diff --git a/www/js/tajian.js b/www/js/tajian.js index cd8c5f5..1f8193b 100644 --- a/www/js/tajian.js +++ b/www/js/tajian.js @@ -103,7 +103,6 @@ if ($('#add_video_form').get(0)) { e.preventDefault(); let inputList = $('#add_video_form input'); - // console.log(inputList[0].value); if (!inputList[0].value) { alert('请填写分享内容或网址!'); return false; @@ -119,7 +118,8 @@ if ($('#add_video_form').get(0)) { let datas = { 'content': inputList[0].value, - 'title': inputList[1].value + 'title': inputList[1].value, + 'tag': $('#add_video_form select').val() } let apiUrl = taJian.debug ? taJian.domain + taJian.apis.addVideos : taJian.apis.addVideos; @@ -139,25 +139,6 @@ if ($('#add_video_form').get(0)) { console.log(jqXHR); }); - // $.ajax({ - // url: '/frontapi/addfav', - // method: 'POST', - // dataType: 'JSON', - // data: datas - // }).done(function (data, textStatus, jqXHR) { - // bt.prop('disabled', false); - - // if (data.code == 1) { - // $(inputList[0]).val(''); - // alert(data.msg || data.err); - // } else { - // alert(data.err); - // } - // }).fail(function (jqXHR, textStatus, errorThrown) { - // bt.prop('disabled', false); - // alert(errorThrown); - // }); - }); }