mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-22 19:44:02 +08:00
Merge branch 'develop' into demo
This commit is contained in:
commit
0e65a72de2
9
LICENSE
9
LICENSE
@ -1,6 +1,5 @@
|
||||
本软件是强业务类型的,并非框架类库,不适合衍生发布。
|
||||
使用协议
|
||||
|
||||
前提条件:不衍生发布,不去除相关版权标识
|
||||
|
||||
1. 在满足前提条件下免费使用,可以二次开发,可以用于商业行为。
|
||||
2. 用户对自己行为负责,有限社区支持,无个体服务。
|
||||
1. 本系统属于强业务类型,非通用类库框架,不适合再次衍生发布。
|
||||
2. 在保留我们版权标识的前提下,用户可以修改以满足自己的需求,可以用于商业用途。
|
||||
3. 有限社区支持,用户对自己的行为负责。
|
12
README.md
12
README.md
@ -1,4 +1,4 @@
|
||||
# 酷瓜云课堂
|
||||
## 酷瓜云课堂
|
||||
|
||||
#### 项目介绍
|
||||
|
||||
@ -6,18 +6,18 @@
|
||||
|
||||
#### 系统功能
|
||||
|
||||
都有些什么功能?我也不想写一大堆,自己体验吧!
|
||||
实现了点播、直播、专栏、会员、微聊等,是一个完整的产品,具体功能我也不想写一大堆,自己体验吧!
|
||||
|
||||
- [前台演示](https://ctc.koogua.com)
|
||||
- [后台演示](https://ctc.koogua.com/admin)
|
||||
|
||||
帐号:100015@163.com / 123456 (前后台通用,请不要修改密码)
|
||||
帐号:100015@163.com / 123456 (前后台通用)
|
||||
|
||||
友情提示:
|
||||
|
||||
- 系统配置低(1核 1G 1M 跑多个容器),手下留情
|
||||
- 系统配置低(1核 1G 1M 跑多个容器),切莫压测
|
||||
- 课程数据来源于网络(无实质内容),切莫购买
|
||||
- 管理后台已禁止提交(私密配置已过滤)
|
||||
- 管理后台已禁止数据提交,私密配置已过滤
|
||||
|
||||
#### 项目组件
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
#### 意见反馈
|
||||
|
||||
- [在线反馈](https://gitee.com/koogua/course-tencent-cloud/issues)
|
||||
- [在线反馈](https://gitee.com/koogua/course-tencent-cloud/issues)(推荐)
|
||||
- QQ邮箱: 76632555@qq.com
|
||||
- QQ群组: 787363898
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Console\Tasks;
|
||||
|
||||
use App\Library\SiteMap;
|
||||
use App\Library\Sitemap;
|
||||
use App\Models\Course as CourseModel;
|
||||
use App\Models\Help as HelpModel;
|
||||
use App\Models\ImGroup as ImGroupModel;
|
||||
@ -12,7 +12,7 @@ use App\Models\User as UserModel;
|
||||
use App\Services\Service as AppService;
|
||||
use Phalcon\Mvc\Model\Resultset;
|
||||
|
||||
class SiteMapTask extends Task
|
||||
class SitemapTask extends Task
|
||||
{
|
||||
|
||||
/**
|
||||
@ -21,15 +21,15 @@ class SiteMapTask extends Task
|
||||
protected $siteUrl;
|
||||
|
||||
/**
|
||||
* @var SiteMap
|
||||
* @var Sitemap
|
||||
*/
|
||||
protected $siteMap;
|
||||
protected $sitemap;
|
||||
|
||||
public function mainAction()
|
||||
{
|
||||
$this->siteUrl = $this->getSiteUrl();
|
||||
|
||||
$this->siteMap = new SiteMap();
|
||||
$this->sitemap = new Sitemap();
|
||||
|
||||
$filename = public_path('sitemap.xml');
|
||||
|
||||
@ -42,7 +42,7 @@ class SiteMapTask extends Task
|
||||
$this->addPages();
|
||||
$this->addOthers();
|
||||
|
||||
$this->siteMap->build($filename);
|
||||
$this->sitemap->build($filename);
|
||||
}
|
||||
|
||||
protected function getSiteUrl()
|
||||
@ -56,7 +56,7 @@ class SiteMapTask extends Task
|
||||
|
||||
protected function addIndex()
|
||||
{
|
||||
$this->siteMap->addItem($this->siteUrl, 1);
|
||||
$this->sitemap->addItem($this->siteUrl, 1);
|
||||
}
|
||||
|
||||
protected function addCourses()
|
||||
@ -70,7 +70,7 @@ class SiteMapTask extends Task
|
||||
|
||||
foreach ($courses as $course) {
|
||||
$loc = sprintf('%s/course/%s', $this->siteUrl, $course->id);
|
||||
$this->siteMap->addItem($loc, 0.8);
|
||||
$this->sitemap->addItem($loc, 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class SiteMapTask extends Task
|
||||
|
||||
foreach ($teachers as $teacher) {
|
||||
$loc = sprintf('%s/teacher/%s', $this->siteUrl, $teacher->id);
|
||||
$this->siteMap->addItem($loc, 0.6);
|
||||
$this->sitemap->addItem($loc, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ class SiteMapTask extends Task
|
||||
|
||||
foreach ($topics as $topic) {
|
||||
$loc = sprintf('%s/topic/%s', $this->siteUrl, $topic->id);
|
||||
$this->siteMap->addItem($loc, 0.6);
|
||||
$this->sitemap->addItem($loc, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ class SiteMapTask extends Task
|
||||
|
||||
foreach ($groups as $group) {
|
||||
$loc = sprintf('%s/im/group/%s', $this->siteUrl, $group->id);
|
||||
$this->siteMap->addItem($loc, 0.6);
|
||||
$this->sitemap->addItem($loc, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ class SiteMapTask extends Task
|
||||
|
||||
foreach ($pages as $page) {
|
||||
$loc = sprintf('%s/page/%s', $this->siteUrl, $page->id);
|
||||
$this->siteMap->addItem($loc, 0.7);
|
||||
$this->sitemap->addItem($loc, 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,18 +145,18 @@ class SiteMapTask extends Task
|
||||
|
||||
foreach ($helps as $help) {
|
||||
$loc = sprintf('%s/help/%s', $this->siteUrl, $help->id);
|
||||
$this->siteMap->addItem($loc, 0.7);
|
||||
$this->sitemap->addItem($loc, 0.7);
|
||||
}
|
||||
}
|
||||
|
||||
protected function addOthers()
|
||||
{
|
||||
$this->siteMap->addItem('/course/list', 0.6);
|
||||
$this->siteMap->addItem('/im/group/list', 0.6);
|
||||
$this->siteMap->addItem('/teacher/list', 0.6);
|
||||
$this->siteMap->addItem('/vip', 0.6);
|
||||
$this->siteMap->addItem('/help', 0.6);
|
||||
$this->siteMap->addItem('/search', 0.6);
|
||||
$this->sitemap->addItem('/course/list', 0.6);
|
||||
$this->sitemap->addItem('/im/group/list', 0.6);
|
||||
$this->sitemap->addItem('/teacher/list', 0.6);
|
||||
$this->sitemap->addItem('/vip', 0.6);
|
||||
$this->sitemap->addItem('/help', 0.6);
|
||||
$this->sitemap->addItem('/search', 0.6);
|
||||
}
|
||||
|
||||
}
|
@ -12,7 +12,7 @@ class HelpController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @Get("/", name="home.help.index")
|
||||
* @Get("/index", name="home.help.index")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ class ImController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @Get("/", name="home.im.index")
|
||||
* @Get("/index", name="home.im.index")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="breadcrumb">
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="/">首页</a>
|
||||
<a><cite>帮助</cite></a>
|
||||
<a><cite>帮助中心</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
@ -5,13 +5,12 @@
|
||||
<div class="breadcrumb">
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="/">首页</a>
|
||||
<a href="{{ url({'for':'home.help.index'}) }}">帮助</a>
|
||||
<a href="{{ url({'for':'home.help.index'}) }}">帮助中心</a>
|
||||
<a><cite>{{ help.title }}</cite></a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="page-info wrap">
|
||||
<div class="title">{{ help.title }}</div>
|
||||
<div class="content" id="preview">{{ help.content }}</div>
|
||||
</div>
|
||||
|
||||
|
@ -27,7 +27,13 @@ class CsrfToken
|
||||
|
||||
public function getToken()
|
||||
{
|
||||
$text = implode($this->delimiter, [time(), $this->fixed, Text::random(8)]);
|
||||
$content = [
|
||||
time() + $this->lifetime,
|
||||
$this->fixed,
|
||||
Text::random(8),
|
||||
];
|
||||
|
||||
$text = implode($this->delimiter, $content);
|
||||
|
||||
return $this->crypt->encryptBase64($text);
|
||||
}
|
||||
@ -40,15 +46,11 @@ class CsrfToken
|
||||
|
||||
$params = explode($this->delimiter, $text);
|
||||
|
||||
if (!isset($params[0]) || !isset($params[1]) || !isset($params[2])) {
|
||||
if (count($params) != 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($params[0] != intval($params[0]) || $params[1] != $this->fixed || strlen($params[2]) != 8) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (time() - $params[0] > $this->lifetime) {
|
||||
if ($params[0] < time() || $params[1] != $this->fixed || strlen($params[2]) != 8) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ class XunSearch extends PaginatorAdapter
|
||||
|
||||
$this->config = $config;
|
||||
$this->_page = $config['page'] ?? 1;
|
||||
$this->_limitRows = $config['limit'] ?? 15;
|
||||
$this->_limitRows = $config['limit'] ?? 12;
|
||||
|
||||
$query = new PaginatorQuery();
|
||||
|
||||
|
@ -42,12 +42,12 @@ class Query
|
||||
|
||||
public function getSort()
|
||||
{
|
||||
return $this->request->getQuery('sort', ['trim', 'string'], '');
|
||||
return $this->request->getQuery('sort', ['trim', 'string']);
|
||||
}
|
||||
|
||||
public function getBaseUrl()
|
||||
{
|
||||
return $this->request->getQuery('_url', ['trim', 'string'], '');
|
||||
return $this->request->getQuery('_url', ['trim', 'string']);
|
||||
}
|
||||
|
||||
public function getParams(array $whitelist = [])
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Library;
|
||||
|
||||
class SiteMap
|
||||
class Sitemap
|
||||
{
|
||||
|
||||
/**
|
@ -128,8 +128,6 @@ class LiveNotify extends Service
|
||||
|
||||
protected function sendBeginNotify(ChapterModel $chapter)
|
||||
{
|
||||
$cache = $this->getCache();
|
||||
|
||||
$redis = $this->getRedis();
|
||||
|
||||
$key = $this->getNotifyKey();
|
||||
@ -141,7 +139,7 @@ class LiveNotify extends Service
|
||||
|
||||
protected function getChapter($streamId)
|
||||
{
|
||||
$id = (int)str_replace('chapter_', '', $streamId);
|
||||
$id = str_replace('chapter_', '', $streamId);
|
||||
|
||||
$chapterRepo = new ChapterRepo();
|
||||
|
||||
@ -164,13 +162,9 @@ class LiveNotify extends Service
|
||||
*/
|
||||
protected function checkSign($sign, $time)
|
||||
{
|
||||
if (empty($sign) || empty($time)) {
|
||||
return false;
|
||||
}
|
||||
if (!$sign || !$time) return false;
|
||||
|
||||
if ($time < time()) {
|
||||
return false;
|
||||
}
|
||||
if ($time < time()) return false;
|
||||
|
||||
$notify = $this->getSettings('live.notify');
|
||||
|
||||
|
@ -49,6 +49,10 @@ Abstract class Smser extends Service
|
||||
|
||||
$result = $content['result'] == 0;
|
||||
|
||||
if ($result == false) {
|
||||
$this->logger->error('Send Message Failed ' . $response);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
$this->logger->error('Send Message Exception ' . kg_json_encode([
|
||||
@ -71,7 +75,7 @@ Abstract class Smser extends Service
|
||||
{
|
||||
$template = json_decode($this->settings['template'], true);
|
||||
|
||||
return $template[$code]['id'] ?? null;
|
||||
return $template[$code] ?? null;
|
||||
}
|
||||
|
||||
protected function getSignature()
|
||||
|
@ -21,6 +21,19 @@
|
||||
color: rgba(255, 255, 255, .7);
|
||||
}
|
||||
|
||||
.layui-main .vditor-reset {
|
||||
font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.vditor-reset ul > li {
|
||||
list-style: disc;
|
||||
}
|
||||
|
||||
.vditor-reset ol > li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.kg-body {
|
||||
padding: 15px;
|
||||
}
|
||||
|
@ -94,7 +94,6 @@
|
||||
|
||||
.layui-main .vditor-reset {
|
||||
font: 14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.vditor-reset ul > li {
|
||||
|
@ -5,7 +5,7 @@ layui.use(['jquery', 'helper'], function () {
|
||||
|
||||
var interval = null;
|
||||
var intervalTime = 15000;
|
||||
var userId = window.koogua.user.id;
|
||||
var userId = window.user.id;
|
||||
var chapterId = $('input[name="chapter.id"]').val();
|
||||
var planId = $('input[name="chapter.plan_id"]').val();
|
||||
var learningUrl = $('input[name="chapter.learning_url"]').val();
|
||||
|
@ -1,7 +1,6 @@
|
||||
layui.use(['jquery', 'layer'], function () {
|
||||
layui.use(['jquery'], function () {
|
||||
|
||||
var $ = layui.jquery;
|
||||
var layer = layui.layer;
|
||||
var element = document.getElementById('preview');
|
||||
var markdown = element.innerHTML;
|
||||
var options = {
|
||||
@ -14,13 +13,8 @@ layui.use(['jquery', 'layer'], function () {
|
||||
|
||||
Vditor.preview(element, markdown, options);
|
||||
|
||||
layer.ready(function () {
|
||||
layer.load(1);
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
$(element).removeClass('layui-hide');
|
||||
layer.closeAll();
|
||||
}, 1000);
|
||||
}, 500);
|
||||
|
||||
});
|
@ -52,7 +52,7 @@ $scheduler->php($script, $bin, ['--task' => 'revoke_vip', '--action' => 'main'])
|
||||
$scheduler->php($script, $bin, ['--task' => 'clean_token', '--action' => 'main'])
|
||||
->daily(3, 17);
|
||||
|
||||
$scheduler->php($script, $bin, ['--task' => 'site_map', '--action' => 'main'])
|
||||
$scheduler->php($script, $bin, ['--task' => 'sitemap', '--action' => 'main'])
|
||||
->daily(4, 3);
|
||||
|
||||
$scheduler->run();
|
Loading…
x
Reference in New Issue
Block a user