From edf1074becfa929960cf5ed816a22fd7205f82d8 Mon Sep 17 00:00:00 2001 From: koogua Date: Wed, 9 Dec 2020 18:04:25 +0800 Subject: [PATCH] =?UTF-8?q?!43=20v1.2.0=E9=98=B6=E6=AE=B5=E6=80=A7?= =?UTF-8?q?=E5=90=88=E5=B9=B6=20*=20Merge=20branches=20'develop'=20and=20'?= =?UTF-8?q?master'=20of=20https://gitee.com/koogua/cour=E2=80=A6=20*=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=80=E5=8F=91=E7=99=BB=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E4=BB=BB=E5=8A=A1=E6=89=A7=E8=A1=8C=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=EF=BC=8C=E5=91=A8=E6=9C=9F=20*=20!41=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=AF=BE=E7=A8=8B=E5=88=86=E7=B1=BB=E6=9C=AA=E8=BF=87?= =?UTF-8?q?=E6=BB=A42=20*=20!40=20=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=9C=AA=E8=BF=87=E6=BB=A42=20*=20!39=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=BE=E7=A8=8B=E5=88=86=E7=B1=BB=E6=9C=AA?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=20*=20!38=20=E4=BF=AE=E5=A4=8D=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E5=88=86=E7=B1=BB=E6=9C=AA=E8=BF=87=E6=BB=A4=20*=20Me?= =?UTF-8?q?rge=20branch=20'master'=20of=20https://gitee.com/koogua/course-?= =?UTF-8?q?tencent-cloud=E2=80=A6=20*=20!36=20=E4=BF=AE=E5=A4=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AF=BE=E7=A8=8B=E5=90=8E=E8=BF=9B=E5=85=A5=E5=88=97?= =?UTF-8?q?=E8=A1=A8500=E9=94=99=E8=AF=AF=20*=20!35=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=85=BE=E8=AE=AF=E4=BA=91=E5=9B=9E=E8=B0=83=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E6=94=B9=E5=8F=98=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=20*=20!34=20=E4=BF=AE=E5=A4=8D=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E8=AF=BE=E6=97=B6=E7=9B=B8=E5=85=B3=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E6=9C=AA=E7=94=9F=E6=88=90=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20*=20!23=20=E4=BF=AE=E5=A4=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=AF=BE=E6=97=B6=E5=90=8E=E8=BF=9B=E5=85=A5=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E9=A1=B5=E9=9D=A2500=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++++ README.md | 6 +++--- app/Http/Admin/Services/Course.php | 11 +++++++++-- app/Http/Admin/Services/Setting.php | 1 + app/Http/Admin/Views/setting/oauth_qq.volt | 2 +- app/Http/Admin/Views/setting/oauth_weibo.volt | 8 +++++++- app/Http/Admin/Views/setting/oauth_weixin.volt | 2 +- app/Library/AppInfo.php | 2 +- .../20201205112717_insert_oauth_setting_data.php | 5 +++++ scheduler.php | 2 +- 10 files changed, 33 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af6041a4..50174e64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### [v1.2.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.2.1)(2020-12-10) +- 增加QQ,微信,微博第三方登录 +- 代码优化以及问题修复 + ### [v1.2.0](https://gitee.com/koogua/course-tencent-cloud/releases/v1.2.0)(2020-11-25) - 增加客户端api - 代码优化以及问题修复 diff --git a/README.md b/README.md index 1d264fff..a6a49470 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ 酷瓜云课堂,依托腾讯云基础服务架构,采用C扩展框架Phalcon开发,GPL-2.0开源协议,致力开源网课系统,开源网校系统,开源在线教育系统。 -![](https://img.shields.io/static/v1?label=release&message=1.2.0&color=blue) -![](https://img.shields.io/static/v1?label=stars&message=101&color=blue) -![](https://img.shields.io/static/v1?label=forks&message=40&color=blue) +![](https://img.shields.io/static/v1?label=release&message=1.2.1&color=blue) +![](https://img.shields.io/static/v1?label=stars&message=112&color=blue) +![](https://img.shields.io/static/v1?label=forks&message=41&color=blue) ![](https://img.shields.io/static/v1?label=license&message=GPL-2.0&color=blue) #### 系统功能 diff --git a/app/Http/Admin/Services/Course.php b/app/Http/Admin/Services/Course.php index 9dba1d7c..7f644d0d 100644 --- a/app/Http/Admin/Services/Course.php +++ b/app/Http/Admin/Services/Course.php @@ -8,6 +8,7 @@ use App\Caches\CourseCategoryList as CourseCategoryListCache; use App\Caches\CourseRelatedList as CourseRelatedListCache; use App\Caches\CourseTeacherList as CourseTeacherListCache; use App\Library\Paginator\Query as PagerQuery; +use App\Models\Category as CategoryModel; use App\Models\Course as CourseModel; use App\Models\CourseCategory as CourseCategoryModel; use App\Models\CourseRating as CourseRatingModel; @@ -224,7 +225,10 @@ class Course extends Service { $categoryRepo = new CategoryRepo(); - $allCategories = $categoryRepo->findAll(['deleted' => 0]); + $allCategories = $categoryRepo->findAll([ + 'type' => CategoryModel::TYPE_COURSE, + 'deleted' => 0, + ]); if ($allCategories->count() == 0) { return []; @@ -247,8 +251,11 @@ class Course extends Service $list = []; + /** + * 没有二级分类的不显示 + */ foreach ($allCategories as $category) { - if ($category->level == 1) { + if ($category->level == 1 && $category->child_count > 0) { $list[$category->id] = [ 'name' => $category->name, 'value' => $category->id, diff --git a/app/Http/Admin/Services/Setting.php b/app/Http/Admin/Services/Setting.php index c04014ed..d6d46164 100644 --- a/app/Http/Admin/Services/Setting.php +++ b/app/Http/Admin/Services/Setting.php @@ -32,6 +32,7 @@ class Setting extends Service $oauth = $this->getSettings('oauth.weibo'); $oauth['redirect_uri'] = $oauth['redirect_uri'] ?: kg_full_url(['for' => 'home.oauth.weibo_callback']); + $oauth['refuse_uri'] = $oauth['refuse_uri'] ?: kg_full_url(['for' => 'home.oauth.weibo_refuse']); return $oauth; } diff --git a/app/Http/Admin/Views/setting/oauth_qq.volt b/app/Http/Admin/Views/setting/oauth_qq.volt index 2f0d2f9a..bcf13f40 100644 --- a/app/Http/Admin/Views/setting/oauth_qq.volt +++ b/app/Http/Admin/Views/setting/oauth_qq.volt @@ -19,7 +19,7 @@
- +
diff --git a/app/Http/Admin/Views/setting/oauth_weibo.volt b/app/Http/Admin/Views/setting/oauth_weibo.volt index c7ca6bae..5b5a7a73 100644 --- a/app/Http/Admin/Views/setting/oauth_weibo.volt +++ b/app/Http/Admin/Views/setting/oauth_weibo.volt @@ -19,11 +19,17 @@
- +
+
+ +
+ +
+
diff --git a/app/Http/Admin/Views/setting/oauth_weixin.volt b/app/Http/Admin/Views/setting/oauth_weixin.volt index 4c08c355..2adfc78f 100644 --- a/app/Http/Admin/Views/setting/oauth_weixin.volt +++ b/app/Http/Admin/Views/setting/oauth_weixin.volt @@ -19,7 +19,7 @@
- +
diff --git a/app/Library/AppInfo.php b/app/Library/AppInfo.php index 569370b3..e0ab2ed3 100644 --- a/app/Library/AppInfo.php +++ b/app/Library/AppInfo.php @@ -11,7 +11,7 @@ class AppInfo protected $link = 'https://gitee.com/koogua'; - protected $version = '1.2.0'; + protected $version = '1.2.1'; public function __get($name) { diff --git a/db/migrations/20201205112717_insert_oauth_setting_data.php b/db/migrations/20201205112717_insert_oauth_setting_data.php index 40cfe6f2..a7e4cf86 100644 --- a/db/migrations/20201205112717_insert_oauth_setting_data.php +++ b/db/migrations/20201205112717_insert_oauth_setting_data.php @@ -70,6 +70,11 @@ final class InsertOauthSettingData extends AbstractMigration 'item_key' => 'redirect_uri', 'item_value' => '', ], + [ + 'section' => 'oauth.weibo', + 'item_key' => 'refuse_uri', + 'item_value' => '', + ], ]; $this->table('kg_setting')->insert($rows)->save(); diff --git a/scheduler.php b/scheduler.php index b038b608..b5b27246 100644 --- a/scheduler.php +++ b/scheduler.php @@ -8,7 +8,7 @@ $scheduler = new Scheduler(); $script = __DIR__ . '/console.php'; -$bin = '/usr/bin/php'; +$bin = '/usr/local/bin/php'; $scheduler->php($script, $bin, ['--task' => 'deliver', '--action' => 'main']) ->at('*/3 * * * *');