From 6f679e74e997d0340a0d2c64a45aa4669214c5c6 Mon Sep 17 00:00:00 2001 From: koogua Date: Wed, 23 Mar 2022 09:44:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E5=85=B3=E9=97=AD=E5=90=8E=E5=85=83=E7=B4=A0=E6=9C=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/home/js/captcha.login.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/public/static/home/js/captcha.login.js b/public/static/home/js/captcha.login.js index 05a10ee3..6586617e 100644 --- a/public/static/home/js/captcha.login.js +++ b/public/static/home/js/captcha.login.js @@ -2,17 +2,19 @@ layui.use(['jquery'], function () { var $ = layui.jquery; - var captcha = new TencentCaptcha( - $('#captcha-btn')[0], - $('#captcha-btn').data('app-id'), - function (res) { - if (res.ret === 0) { - $('#ticket').val(res.ticket); - $('#rand').val(res.randstr); - $('#captcha-block').hide(); - $('#submit-btn').removeClass('layui-btn-disabled').removeAttr('disabled'); + if ($('#captcha-btn').length > 0) { + var captcha = new TencentCaptcha( + $('#captcha-btn')[0], + $('#captcha-btn').data('app-id'), + function (res) { + if (res.ret === 0) { + $('#ticket').val(res.ticket); + $('#rand').val(res.randstr); + $('#captcha-block').hide(); + $('#submit-btn').removeClass('layui-btn-disabled').removeAttr('disabled'); + } } - } - ); + ); + } }); \ No newline at end of file From c77e1801ace11ea23138c86c528619760d565acf Mon Sep 17 00:00:00 2001 From: koogua Date: Wed, 23 Mar 2022 09:52:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E5=85=B3=E9=97=AD=E5=90=8E=E5=8F=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Home/Services/Account.php | 12 ++++++++++-- app/Services/Logic/Verify/MailCode.php | 9 +++++++-- app/Services/Logic/Verify/SmsCode.php | 9 +++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/app/Http/Home/Services/Account.php b/app/Http/Home/Services/Account.php index 929c30ac..8516bcad 100644 --- a/app/Http/Home/Services/Account.php +++ b/app/Http/Home/Services/Account.php @@ -53,9 +53,17 @@ class Account extends Service $validator->checkIfAllowLogin($user); - $validator = new CaptchaValidator(); + $captcha = $this->getSettings('captcha'); - $validator->checkCode($post['ticket'], $post['rand']); + /** + * 验证码是一次性的,放到最后检查,减少第三方调用 + */ + if ($captcha['enabled'] == 1) { + + $validator = new CaptchaValidator(); + + $validator->checkCode($post['ticket'], $post['rand']); + } $this->auth->saveAuthInfo($user); diff --git a/app/Services/Logic/Verify/MailCode.php b/app/Services/Logic/Verify/MailCode.php index 9a04d1dc..d3cb7768 100644 --- a/app/Services/Logic/Verify/MailCode.php +++ b/app/Services/Logic/Verify/MailCode.php @@ -23,9 +23,14 @@ class MailCode extends LogicService $post['email'] = $validator->checkEmail($post['email']); - $validator = new CaptchaValidator(); + $captcha = $this->getSettings('captcha'); - $validator->checkCode($post['ticket'], $post['rand']); + if ($captcha['enabled'] == 1) { + + $validator = new CaptchaValidator(); + + $validator->checkCode($post['ticket'], $post['rand']); + } $service = new MailVerifyService(); diff --git a/app/Services/Logic/Verify/SmsCode.php b/app/Services/Logic/Verify/SmsCode.php index c97dbd56..adcbb080 100644 --- a/app/Services/Logic/Verify/SmsCode.php +++ b/app/Services/Logic/Verify/SmsCode.php @@ -23,9 +23,14 @@ class SmsCode extends LogicService $post['phone'] = $validator->checkPhone($post['phone']); - $validator = new CaptchaValidator(); + $captcha = $this->getSettings('captcha'); - $validator->checkCode($post['ticket'], $post['rand']); + if ($captcha['enabled'] == 1) { + + $validator = new CaptchaValidator(); + + $validator->checkCode($post['ticket'], $post['rand']); + } $service = new SmsVerifyService(); From af65adaf945995875c41c91163125489230fd81c Mon Sep 17 00:00:00 2001 From: koogua Date: Sat, 30 Apr 2022 11:23:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E8=A1=A5=E5=85=85=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=AF=BE=E7=A8=8B=E6=95=B0=E6=8D=AE=E7=BB=93?= =?UTF-8?q?=E6=9E=84=202.=E8=B0=83=E6=95=B4=E5=8F=91=E9=80=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E7=9B=B8=E5=85=B3=E6=A0=B7=E5=BC=8F=203.?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A5=97=E9=A4=90=E5=92=8C=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E8=AF=BE=E7=A8=8B=E6=95=B0=E6=8D=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=204.=E5=8E=BB=E9=99=A4=E7=A4=BC=E7=89=A9=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=B8=AD=E5=A4=9A=E5=87=BA=E6=9D=A5=E7=9A=84"}}"?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=205.=E4=BF=AE=E6=AD=A3=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=A7=92=E6=9D=80=E8=AE=A2=E5=8D=95=E6=97=B6=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=9B=9E=E5=A1=AB=E5=BA=93=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=206.vditor=E7=BC=96=E8=BE=91=E5=99=A8=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E4=B8=BA=E4=B8=83=E7=89=9Bcdn=E5=8A=A0=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 ++++++++ app/Builders/CourseTopicList.php | 2 +- app/Console/Tasks/CloseFlashSaleOrderTask.php | 13 +++++++++++ app/Http/Admin/Services/ChapterContent.php | 22 ------------------- app/Http/Admin/Services/Package.php | 3 ++- app/Http/Admin/Services/Slide.php | 3 ++- app/Http/Admin/Services/Topic.php | 3 ++- app/Http/Admin/Views/answer/add.volt | 4 ++-- app/Http/Admin/Views/answer/edit.volt | 4 ++-- app/Http/Admin/Views/article/edit.volt | 4 ++-- app/Http/Admin/Views/chapter/edit_lesson.volt | 4 ++-- app/Http/Admin/Views/course/edit.volt | 4 ++-- app/Http/Admin/Views/help/add.volt | 4 ++-- app/Http/Admin/Views/help/edit.volt | 4 ++-- app/Http/Admin/Views/page/add.volt | 4 ++-- app/Http/Admin/Views/page/edit.volt | 4 ++-- app/Http/Admin/Views/point_gift/edit.volt | 4 ++-- app/Http/Admin/Views/question/edit.volt | 4 ++-- app/Http/Home/Services/FullH5Url.php | 16 +++++++++++++- .../Home/Views/account/forget_password.volt | 2 +- app/Http/Home/Views/account/register.volt | 2 +- app/Http/Home/Views/answer/add.volt | 4 ++-- app/Http/Home/Views/answer/edit.volt | 4 ++-- app/Http/Home/Views/article/edit.volt | 4 ++-- app/Http/Home/Views/course/show_meta.volt | 2 +- app/Http/Home/Views/point_gift/show.volt | 2 +- app/Http/Home/Views/question/edit.volt | 4 ++-- .../Views/user/console/account_email.volt | 2 +- .../Views/user/console/account_phone.volt | 2 +- app/Library/AppInfo.php | 2 +- config/errors.php | 2 +- public/static/home/js/captcha.verify.js | 6 ++++- 32 files changed, 87 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6238fc4..729de666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### [v1.5.2](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.2)(2022-04-17) + +- 补充话题列表课程数据结构 +- 调整发送验证码相关样式 +- 优化套餐和话题下拉课程数据显示 +- 去除礼物详情中多出来的"}}"标签 +- 修正关闭秒杀订单时没有回填库存的问题 +- vditor编辑器切换为七牛cdn加速 + ### [v1.5.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.5.1)(2022-03-17) - 推荐课程等列表补充属性 diff --git a/app/Builders/CourseTopicList.php b/app/Builders/CourseTopicList.php index 88ec8643..6a7ebf2d 100644 --- a/app/Builders/CourseTopicList.php +++ b/app/Builders/CourseTopicList.php @@ -45,7 +45,7 @@ class CourseTopicList extends Builder 'id', 'title', 'cover', 'market_price', 'vip_price', 'rating', 'model', 'level', 'attrs', - 'user_count', 'lesson_count', + 'user_count', 'lesson_count', 'review_count', 'favorite_count', ]; $courses = $courseRepo->findByIds($ids, $columns); diff --git a/app/Console/Tasks/CloseFlashSaleOrderTask.php b/app/Console/Tasks/CloseFlashSaleOrderTask.php index e51da67c..b83afe2b 100644 --- a/app/Console/Tasks/CloseFlashSaleOrderTask.php +++ b/app/Console/Tasks/CloseFlashSaleOrderTask.php @@ -8,6 +8,7 @@ namespace App\Console\Tasks; use App\Models\Order as OrderModel; +use App\Repos\FlashSale as FlashSaleRepo; use App\Services\Logic\FlashSale\Queue as FlashSaleQueue; use App\Services\Logic\FlashSale\UserOrderCache; use Phalcon\Mvc\Model\Resultset; @@ -27,6 +28,7 @@ class CloseFlashSaleOrderTask extends Task echo '------ start close order task ------' . PHP_EOL; foreach ($orders as $order) { + $this->incrFlashSaleStock($order->promotion_id); $this->pushFlashSaleQueue($order->promotion_id); $this->deleteUserOrderCache($order->owner_id, $order->promotion_id); $order->status = OrderModel::STATUS_CLOSED; @@ -36,6 +38,17 @@ class CloseFlashSaleOrderTask extends Task echo '------ end close order task ------' . PHP_EOL; } + protected function incrFlashSaleStock($saleId) + { + $flashSaleRepo = new FlashSaleRepo(); + + $flashSale = $flashSaleRepo->findById($saleId); + + $flashSale->stock += 1; + + $flashSale->update(); + } + protected function pushFlashSaleQueue($saleId) { $queue = new FlashSaleQueue(); diff --git a/app/Http/Admin/Services/ChapterContent.php b/app/Http/Admin/Services/ChapterContent.php index 3cc3fda3..5d257fc5 100644 --- a/app/Http/Admin/Services/ChapterContent.php +++ b/app/Http/Admin/Services/ChapterContent.php @@ -15,7 +15,6 @@ use App\Repos\Chapter as ChapterRepo; use App\Repos\Course as CourseRepo; use App\Services\ChapterVod as ChapterVodService; use App\Services\CourseStat as CourseStatService; -use App\Services\Vod as VodService; use App\Validators\ChapterLive as ChapterLiveValidator; use App\Validators\ChapterOffline as ChapterOfflineValidator; use App\Validators\ChapterRead as ChapterReadValidator; @@ -134,28 +133,14 @@ class ChapterContent extends Service $vod = $chapterRepo->findChapterVod($chapter->id); - /** - * 无新文件上传 - */ - if ($fileId == $vod->file_id) return; - - /** - * 删除旧文件 - */ - if ($vod->file_id) { - $this->deleteVodFile($vod->file_id); - } - $vod->file_id = $fileId; $vod->file_transcode = []; - $vod->update(); $attrs = $chapter->attrs; $attrs['duration'] = 0; $attrs['file']['status'] = ChapterModel::FS_UPLOADED; $chapter->attrs = $attrs; - $chapter->update(); $this->updateCourseVodAttrs($vod->course_id); @@ -331,13 +316,6 @@ class ChapterContent extends Service $statService->updateOfflineAttrs($courseId); } - protected function deleteVodFile($fileId) - { - $vodService = new VodService(); - - $vodService->deleteMedia($fileId); - } - protected function rebuildCatalogCache(ChapterModel $chapter) { $cache = new CatalogCache(); diff --git a/app/Http/Admin/Services/Package.php b/app/Http/Admin/Services/Package.php index f42e040e..ec92f2ae 100644 --- a/app/Http/Admin/Services/Package.php +++ b/app/Http/Admin/Services/Package.php @@ -59,8 +59,9 @@ class Package extends Service $result = []; foreach ($items as $item) { + $price = $item->market_price > 0 ? sprintf("¥%0.2f", $item->market_price) : '免费'; $result[] = [ - 'name' => sprintf('%s - %s(¥%0.2f)', $item->id, $item->title, $item->market_price), + 'name' => sprintf('%s - %s(¥%0.2f)', $item->id, $item->title, $price), 'value' => $item->id, 'selected' => in_array($item->id, $courseIds), ]; diff --git a/app/Http/Admin/Services/Slide.php b/app/Http/Admin/Services/Slide.php index 685e88ef..492284e1 100644 --- a/app/Http/Admin/Services/Slide.php +++ b/app/Http/Admin/Services/Slide.php @@ -34,8 +34,9 @@ class Slide extends Service $result = []; foreach ($items as $item) { + $price = $item->market_price > 0 ? sprintf("¥%0.2f", $item->market_price) : '免费'; $result[] = [ - 'name' => sprintf('%s(¥%0.2f)', $item->title, $item->market_price), + 'name' => sprintf('%s- %s(%s)', $item->id, $item->title, $price), 'value' => $item->id, ]; } diff --git a/app/Http/Admin/Services/Topic.php b/app/Http/Admin/Services/Topic.php index 5b336cb7..b463a716 100644 --- a/app/Http/Admin/Services/Topic.php +++ b/app/Http/Admin/Services/Topic.php @@ -45,8 +45,9 @@ class Topic extends Service $result = []; foreach ($items as $item) { + $price = $item->market_price > 0 ? sprintf("¥%0.2f", $item->market_price) : '免费'; $result[] = [ - 'name' => sprintf('%s - %s(¥%0.2f)', $item->id, $item->title, $item->market_price), + 'name' => sprintf('%s - %s(¥%0.2f)', $item->id, $item->title, $price), 'value' => $item->id, 'selected' => in_array($item->id, $courseIds), ]; diff --git a/app/Http/Admin/Views/answer/add.volt b/app/Http/Admin/Views/answer/add.volt index d0e4792d..f7c65072 100644 --- a/app/Http/Admin/Views/answer/add.volt +++ b/app/Http/Admin/Views/answer/add.volt @@ -29,13 +29,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/answer/edit.volt b/app/Http/Admin/Views/answer/edit.volt index 4812e5c8..8469dd47 100644 --- a/app/Http/Admin/Views/answer/edit.volt +++ b/app/Http/Admin/Views/answer/edit.volt @@ -28,13 +28,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/article/edit.volt b/app/Http/Admin/Views/article/edit.volt index 179f055e..dc9fa67f 100644 --- a/app/Http/Admin/Views/article/edit.volt +++ b/app/Http/Admin/Views/article/edit.volt @@ -25,13 +25,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('lib/xm-select.js') }} {{ js_include('admin/js/vditor.js') }} diff --git a/app/Http/Admin/Views/chapter/edit_lesson.volt b/app/Http/Admin/Views/chapter/edit_lesson.volt index 8d9bd066..b42b75d6 100644 --- a/app/Http/Admin/Views/chapter/edit_lesson.volt +++ b/app/Http/Admin/Views/chapter/edit_lesson.volt @@ -50,7 +50,7 @@ {% block link_css %} {% if chapter.model == 3 %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endif %} {% endblock %} @@ -59,7 +59,7 @@ {% if chapter.model == 3 %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/vditor.js') }} {% elseif chapter.model == 1 %} diff --git a/app/Http/Admin/Views/course/edit.volt b/app/Http/Admin/Views/course/edit.volt index 70d6f475..a8dc5e15 100644 --- a/app/Http/Admin/Views/course/edit.volt +++ b/app/Http/Admin/Views/course/edit.volt @@ -41,13 +41,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('lib/xm-select.js') }} {{ js_include('admin/js/cover.upload.js') }} {{ js_include('admin/js/vditor.js') }} diff --git a/app/Http/Admin/Views/help/add.volt b/app/Http/Admin/Views/help/add.volt index fe2a2508..947a986d 100644 --- a/app/Http/Admin/Views/help/add.volt +++ b/app/Http/Admin/Views/help/add.volt @@ -49,13 +49,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/help/edit.volt b/app/Http/Admin/Views/help/edit.volt index 72cf83dd..f084dc67 100644 --- a/app/Http/Admin/Views/help/edit.volt +++ b/app/Http/Admin/Views/help/edit.volt @@ -56,13 +56,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/page/add.volt b/app/Http/Admin/Views/page/add.volt index 399e5fe8..1447d34f 100644 --- a/app/Http/Admin/Views/page/add.volt +++ b/app/Http/Admin/Views/page/add.volt @@ -32,13 +32,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/page/edit.volt b/app/Http/Admin/Views/page/edit.volt index 532b3b3f..9b3b6c26 100644 --- a/app/Http/Admin/Views/page/edit.volt +++ b/app/Http/Admin/Views/page/edit.volt @@ -45,13 +45,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/vditor.js') }} {% endblock %} \ No newline at end of file diff --git a/app/Http/Admin/Views/point_gift/edit.volt b/app/Http/Admin/Views/point_gift/edit.volt index 8c1d654f..6d0494e6 100644 --- a/app/Http/Admin/Views/point_gift/edit.volt +++ b/app/Http/Admin/Views/point_gift/edit.volt @@ -15,7 +15,7 @@ {% block link_css %} {% if gift.type == 2 %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endif %} {% endblock %} @@ -23,7 +23,7 @@ {% block include_js %} {% if gift.type == 2 %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('admin/js/cover.upload.js') }} {{ js_include('admin/js/vditor.js') }} {% endif %} diff --git a/app/Http/Admin/Views/question/edit.volt b/app/Http/Admin/Views/question/edit.volt index c99a7fc0..9158bf95 100644 --- a/app/Http/Admin/Views/question/edit.volt +++ b/app/Http/Admin/Views/question/edit.volt @@ -25,13 +25,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('lib/xm-select.js') }} {{ js_include('admin/js/vditor.js') }} diff --git a/app/Http/Home/Services/FullH5Url.php b/app/Http/Home/Services/FullH5Url.php index cd161aa1..7df818d1 100644 --- a/app/Http/Home/Services/FullH5Url.php +++ b/app/Http/Home/Services/FullH5Url.php @@ -7,6 +7,8 @@ namespace App\Http\Home\Services; +use App\Models\Course as CourseModel; +use App\Repos\Chapter as ChapterRepo; use App\Traits\Client as ClientTrait; class FullH5Url extends Service @@ -118,7 +120,19 @@ class FullH5Url extends Service public function getChapterInfoUrl($id) { - return sprintf('%s/chapter/info?id=%s', $this->baseUrl, $id); + $chapterRepo = new ChapterRepo(); + + $chapter = $chapterRepo->findById($id); + + if ($chapter->model == CourseModel::MODEL_VOD) { + return sprintf('%s/chapter/vod?id=%s', $this->baseUrl, $id); + } elseif ($chapter->model == CourseModel::MODEL_LIVE) { + return sprintf('%s/chapter/live?id=%s', $this->baseUrl, $id); + } elseif ($chapter->model == CourseModel::MODEL_READ) { + return sprintf('%s/chapter/read?id=%s', $this->baseUrl, $id); + } else { + return $this->getHomeUrl(); + } } public function getUserIndexUrl($id) diff --git a/app/Http/Home/Views/account/forget_password.volt b/app/Http/Home/Views/account/forget_password.volt index 5683bf28..8872c571 100644 --- a/app/Http/Home/Views/account/forget_password.volt +++ b/app/Http/Home/Views/account/forget_password.volt @@ -23,7 +23,7 @@
- +
diff --git a/app/Http/Home/Views/account/register.volt b/app/Http/Home/Views/account/register.volt index 06a11a06..2fc97fb4 100644 --- a/app/Http/Home/Views/account/register.volt +++ b/app/Http/Home/Views/account/register.volt @@ -38,7 +38,7 @@
- +
diff --git a/app/Http/Home/Views/answer/add.volt b/app/Http/Home/Views/answer/add.volt index ca714746..67bc707e 100644 --- a/app/Http/Home/Views/answer/add.volt +++ b/app/Http/Home/Views/answer/add.volt @@ -41,13 +41,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('home/js/answer.edit.js') }} {{ js_include('home/js/vditor.js') }} diff --git a/app/Http/Home/Views/answer/edit.volt b/app/Http/Home/Views/answer/edit.volt index 2d9ab136..8bab1356 100644 --- a/app/Http/Home/Views/answer/edit.volt +++ b/app/Http/Home/Views/answer/edit.volt @@ -36,13 +36,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('home/js/answer.edit.js') }} {{ js_include('home/js/vditor.js') }} diff --git a/app/Http/Home/Views/article/edit.volt b/app/Http/Home/Views/article/edit.volt index 614ecca6..4e13cee7 100644 --- a/app/Http/Home/Views/article/edit.volt +++ b/app/Http/Home/Views/article/edit.volt @@ -76,13 +76,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('lib/xm-select.js') }} {{ js_include('home/js/article.edit.js') }} {{ js_include('home/js/vditor.js') }} diff --git a/app/Http/Home/Views/course/show_meta.volt b/app/Http/Home/Views/course/show_meta.volt index 6241931c..a0d37b9a 100644 --- a/app/Http/Home/Views/course/show_meta.volt +++ b/app/Http/Home/Views/course/show_meta.volt @@ -96,7 +96,7 @@
{{ model_type(course.model) }} - {{ course.title }} + {{ course.title }}
{% if course.model == 1 %} diff --git a/app/Http/Home/Views/point_gift/show.volt b/app/Http/Home/Views/point_gift/show.volt index cf0c7af2..f0951f4a 100644 --- a/app/Http/Home/Views/point_gift/show.volt +++ b/app/Http/Home/Views/point_gift/show.volt @@ -32,7 +32,7 @@ {{ gift.name }}

{% else %} -

{{ gift.name }} }}

+

{{ gift.name }}

{% endif %}

兑换人次 diff --git a/app/Http/Home/Views/question/edit.volt b/app/Http/Home/Views/question/edit.volt index a0b3e01f..9937e879 100644 --- a/app/Http/Home/Views/question/edit.volt +++ b/app/Http/Home/Views/question/edit.volt @@ -56,13 +56,13 @@ {% block link_css %} - {{ css_link('https://cdn.jsdelivr.net/npm/vditor/dist/index.css', false) }} + {{ css_link('https://cdn.staticfile.org/vditor/3.8.13/index.css', false) }} {% endblock %} {% block include_js %} - {{ js_include('https://cdn.jsdelivr.net/npm/vditor/dist/index.min.js', false) }} + {{ js_include('https://cdn.staticfile.org/vditor/3.8.13/index.min.js', false) }} {{ js_include('lib/xm-select.js') }} {{ js_include('home/js/question.edit.js') }} {{ js_include('home/js/vditor.js') }} diff --git a/app/Http/Home/Views/user/console/account_email.volt b/app/Http/Home/Views/user/console/account_email.volt index 18cd2115..b478c723 100644 --- a/app/Http/Home/Views/user/console/account_email.volt +++ b/app/Http/Home/Views/user/console/account_email.volt @@ -28,7 +28,7 @@

- +
diff --git a/app/Http/Home/Views/user/console/account_phone.volt b/app/Http/Home/Views/user/console/account_phone.volt index 7c34aa58..a27ff982 100644 --- a/app/Http/Home/Views/user/console/account_phone.volt +++ b/app/Http/Home/Views/user/console/account_phone.volt @@ -28,7 +28,7 @@
- +
diff --git a/app/Library/AppInfo.php b/app/Library/AppInfo.php index a4dea0cb..036f5fac 100644 --- a/app/Library/AppInfo.php +++ b/app/Library/AppInfo.php @@ -16,7 +16,7 @@ class AppInfo protected $link = 'https://koogua.com'; - protected $version = '1.5.1'; + protected $version = '1.5.2'; public function __get($name) { diff --git a/config/errors.php b/config/errors.php index b0249c45..eba0fcdc 100644 --- a/config/errors.php +++ b/config/errors.php @@ -52,7 +52,7 @@ $error['account.login_pwd_incorrect'] = '登录密码不正确'; $error['account.invalid_login_name'] = '无效的登录名'; $error['account.invalid_email'] = '无效的电子邮箱'; $error['account.invalid_phone'] = '无效的手机号'; -$error['account.invalid_pwd'] = '无效的密码(字母或数字6-16位)'; +$error['account.invalid_pwd'] = '无效的密码(字母|数字|特殊字符6-16位)'; $error['account.email_taken'] = '邮箱被占用'; $error['account.phone_taken'] = '手机号被占用'; $error['account.pwd_not_match'] = '密码不匹配'; diff --git a/public/static/home/js/captcha.verify.js b/public/static/home/js/captcha.verify.js index 2196ffdf..1cc4a05c 100644 --- a/public/static/home/js/captcha.verify.js +++ b/public/static/home/js/captcha.verify.js @@ -1,6 +1,7 @@ -layui.use(['jquery', 'util'], function () { +layui.use(['jquery', 'layer', 'util'], function () { var $ = layui.jquery; + var layer = layui.layer; var util = layui.util; var timeCounting = false; @@ -62,6 +63,9 @@ layui.use(['jquery', 'util'], function () { type: 'POST', url: postUrl, data: postData, + success: function () { + layer.msg('发送验证码成功', {icon: 1}); + } }); $submit.removeClass('layui-btn-disabled').removeAttr('disabled'); $emit.addClass('layui-btn-disabled').attr('disabled', 'disabled');