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 * * * *');