1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-29 22:01:38 +08:00

Merge branch 'develop' into demo

# Conflicts:
#	app/Http/Admin/Controllers/SettingController.php
#	app/Http/Admin/Services/Setting.php
#	db/migrations/20200827112717_insert_setting_data.php
This commit is contained in:
xiaochong0302 2020-09-07 10:26:21 +08:00
commit 387503c218
79 changed files with 2995 additions and 3657 deletions

View File

@ -6,39 +6,44 @@
都有些什么功能?我也不想写一大堆,自己体验吧!
帐号100015@163.com / 123456 (前后台通用)
PS**系统后台已禁止提交并隐藏私人配置**
- [前台演示](https://ctc.koogua.com)
- [后台演示](https://ctc.koogua.com/admin)
- [系统截图](https://gitee.com/koogua/course-tencent-cloud/wikis/系统截图)
体验帐号: 100015@163.com / 123456
#### 项目组件
- 后台框架:[phalcon 3.4.5](https://phalcon.io)
- 前端框架:[layui 2.5.6](https://layui.com) [layim 3.9.5](https://www.layui.com/layim)(已授权)
- 全文检索:[xunsearch 1.4.9](http://www.xunsearch.com)
- 即时通讯:[workerman 3.5.22](https://workerman.net)
- 其它依赖:[php7.3](https://php.net) [mysql5.7](https://mysql.com) [redis5.0](https://redis.io)
#### 使用协议
虽然尝试了解开源协议,但是似乎不得要领,干脆用自己的协议吧,算不算开源我也不很清楚。
虽然尝试了解过开源协议,但是理解的模棱两可,干脆用自己的协议吧,算不算开源我也不很清楚。
1. 本系统属于强业务类型,非通用类库框架,不适合再次衍生发布。
2. 在保留我们版权标识的前提下,用户可以修改以满足自己的需求,可以用于商业用途。
3. 有限社区支持,用户对自己的行为负责。
#### 安装指南
- [运行环境搭建](https://gitee.com/koogua/course-tencent-cloud-docker)
- [系统服务配置](https://gitee.com/koogua/course-tencent-cloud/wikis/服务配置)
#### 会推出商业服务吗?
- 如果不符合您对“开源”的认知,请移步其它同类产品,毕竟同类“免费”产品也很多。
- 如果“开源”版本不能满足您的需求,或者您更希望有更好的支持,商业服务是不错的选择。
- 如果“开源”版本不能满足您的需求,或者您希望有更好的支持,商业服务是不错的选择。
我们目前提供的服务
我们为用户提供的服务包括
- 安装服务
- 会员服务
- 定制服务
- 系统安装
- 系统定制
- 企业会员
#### 会有阿里云版吗?
@ -50,11 +55,9 @@ PS**系统后台已禁止提交并隐藏私人配置**
#### 通过这个项目能学到什么?
把所有代码看完,希望对你有启发。把各个环节跑通,会引出很多知识。
1. 项目规划phalcon实战缓存JWTwebsocket即时通讯
2. docker操作docker服务编排
3. gitlinuxphpmysqlredisnginx ...
1. 项目规划phalcon实战缓存JWT即时通讯全文检索
2. docker操作docker服务编排supervisordevops
3. gitlinuxphpmysqlredisnginx
#### 开发计划

View File

@ -73,7 +73,7 @@ class ConsultList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -45,7 +45,7 @@ class CourseFavoriteList extends Builder
$courses = $courseRepo->findByIds($ids, $columns);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];
@ -69,7 +69,7 @@ class CourseFavoriteList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -61,7 +61,7 @@ class CourseList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -45,7 +45,7 @@ class CourseTopicList extends Builder
$courses = $courseRepo->findByIds($ids, $columns);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -45,7 +45,7 @@ class CourseUserList extends Builder
$courses = $courseRepo->findByIds($ids, $columns);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];
@ -66,7 +66,7 @@ class CourseUserList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -84,7 +84,7 @@ class DanmuList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -31,7 +31,7 @@ class ImFriendUserList extends Builder
$users = $userRepo->findByIds($ids, $columns);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -55,7 +55,7 @@ class ImGroupList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -40,7 +40,7 @@ class ImGroupUserList extends Builder
$users = $userRepo->findByIds($ids, $columns);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];
@ -64,7 +64,7 @@ class ImGroupUserList extends Builder
$users = $this->getGroupOwners($groups->toArray());
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -26,7 +26,7 @@ class ImMessageList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -12,7 +12,7 @@ class OrderList extends Builder
public function __construct()
{
$this->imgBaseUrl = kg_ci_base_url();
$this->imgBaseUrl = kg_ss_url();
}
/**

View File

@ -55,7 +55,7 @@ class ReviewList extends Builder
$users = $userRepo->findByIds($ids, ['id', 'name', 'avatar']);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];

View File

@ -10,7 +10,7 @@ class UserList extends Builder
public function handleUsers(array $users)
{
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
foreach ($users as $key => $user) {
$users[$key]['avatar'] = $baseUrl . $user['avatar'];

View File

@ -4,39 +4,32 @@ namespace App\Console\Tasks;
use App\Library\Cache\Backend\Redis as RedisCache;
use Phalcon\Cli\Task;
use Phalcon\Config;
class CleanSessionTask extends Task
{
/**
* @var RedisCache
*/
protected $cache;
/**
* @var \Redis
*/
protected $redis;
public function mainAction()
{
$this->cache = $this->getDI()->get('cache');
$config = $this->getConfig();
$this->redis = $this->cache->getRedis();
$cache = $this->getCache();
$redis = $cache->getRedis();
$redis->select($config->path('session.db'));
$keys = $this->querySessionKeys(10000);
if (count($keys) == 0) return;
$config = $this->getDI()->get('config');
$lifetime = $config->session->lifetime;
$lifetime = $config->path('session.lifetime');
foreach ($keys as $key) {
$ttl = $this->redis->ttl($key);
$content = $this->redis->get($key);
$ttl = $redis->ttl($key);
$content = $redis->get($key);
if (empty($content) && $ttl < $lifetime * 0.5) {
$this->redis->del($key);
$redis->del($key);
}
}
}
@ -49,7 +42,29 @@ class CleanSessionTask extends Task
*/
protected function querySessionKeys($limit)
{
return $this->cache->queryKeys('_PHCR', $limit);
$cache = $this->getCache();
return $cache->queryKeys('_PHCR', $limit);
}
protected function getConfig()
{
/**
* @var Config $config
*/
$config = $this->getDI()->get('config');
return $config;
}
protected function getCache()
{
/**
* @var RedisCache $cache
*/
$cache = $this->getDI()->get('cache');
return $cache;
}
}

View File

@ -5,7 +5,6 @@ namespace App\Http\Admin\Controllers;
use App\Http\Admin\Services\Chapter as ChapterService;
use App\Http\Admin\Services\ChapterContent as ChapterContentService;
use App\Http\Admin\Services\Course as CourseService;
use App\Http\Admin\Services\Setting as SettingService;
use App\Models\Course as CourseModel;
/**
@ -86,13 +85,10 @@ class ChapterController extends Controller
$contentService = new ChapterContentService();
$chapterService = new ChapterService();
$courseService = new CourseService();
$settingService = new SettingService();
$chapter = $chapterService->getChapter($id);
$course = $courseService->getCourse($chapter->course_id);
$storage = $settingService->getSectionSettings('storage');
$this->view->setVar('storage', $storage);
$this->view->setVar('chapter', $chapter);
$this->view->setVar('course', $course);

View File

@ -31,7 +31,7 @@ class SettingController extends Controller
$site = $settingService->getSectionSettings($section);
$site['base_url'] = $site['base_url'] ?: kg_site_base_url();
$site['url'] = $site['url'] ?: kg_site_url();
$this->view->setVar('site', $site);
}
@ -67,7 +67,7 @@ class SettingController extends Controller
*/
public function storageAction()
{
$section = 'storage';
$section = 'cos';
$settingService = new SettingService();
@ -81,9 +81,9 @@ class SettingController extends Controller
} else {
$storage = $settingService->getSectionSettings($section);
$cos = $settingService->getSectionSettings($section);
$this->view->setVar('storage', $storage);
$this->view->setVar('cos', $cos);
}
}

View File

@ -22,7 +22,7 @@ class UploadController extends Controller
if ($file) {
return $this->jsonSuccess([
'data' => [
'src' => $service->getCiImageUrl($file->path),
'src' => $service->getImageUrl($file->path),
'title' => $file->name,
]
]);
@ -43,7 +43,7 @@ class UploadController extends Controller
if ($file) {
return $this->jsonSuccess([
'data' => [
'src' => $service->getCiImageUrl($file->path),
'src' => $service->getImageUrl($file->path),
'title' => $file->name,
]
]);
@ -64,7 +64,7 @@ class UploadController extends Controller
if ($file) {
return $this->jsonSuccess([
'data' => [
'src' => $service->getCiImageUrl($file->path),
'src' => $service->getImageUrl($file->path),
'title' => $file->name,
]
]);

View File

@ -94,12 +94,8 @@ class Setting extends Service
{
$protocol = ['http://', 'https://'];
if (isset($settings['bucket_domain'])) {
$settings['bucket_domain'] = str_replace($protocol, '', $settings['bucket_domain']);
}
if (isset($settings['ci_domain'])) {
$settings['ci_domain'] = str_replace($protocol, '', $settings['ci_domain']);
if (isset($settings['domain'])) {
$settings['domain'] = str_replace($protocol, '', $settings['domain']);
}
$this->updateSectionSettings($section, $settings);
@ -114,12 +110,10 @@ class Setting extends Service
{
$protocol = ['http://', 'https://'];
if (isset($settings['push_domain'])) {
$settings['push_domain'] = str_replace($protocol, '', $settings['push_domain']);
if (in_array($section, ['live.push', 'live.pull'])) {
if (isset($settings['domain'])) {
$settings['domain'] = str_replace($protocol, '', $settings['domain']);
}
if (isset($settings['pull_domain'])) {
$settings['pull_domain'] = str_replace($protocol, '', $settings['pull_domain']);
}
$this->updateSectionSettings($section, $settings);

View File

@ -26,11 +26,11 @@
{{ partial('chapter/edit_lesson_basic') }}
</div>
<div class="layui-tab-item">
{% if course.model == '1' %}
{% if course.model == 1 %}
{{ partial('chapter/edit_lesson_vod') }}
{% elseif course.model == '2' %}
{% elseif course.model == 2 %}
{{ partial('chapter/edit_lesson_live') }}
{% elseif course.model == '3' %}
{% elseif course.model == 3 %}
{{ partial('chapter/edit_lesson_read') }}
{% endif %}
</div>

View File

@ -49,13 +49,14 @@
</thead>
<tbody>
{% for item in pager.items %}
{% set preview_url = url({'for':'desktop.group.show','id':item.id}) %}
{% set edit_url = url({'for':'admin.group.edit','id':item.id}) %}
{% set update_url = url({'for':'admin.group.update','id':item.id}) %}
{% set delete_url = url({'for':'admin.group.delete','id':item.id}) %}
{% set restore_url = url({'for':'admin.group.restore','id':item.id}) %}
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }} {{ type_info(item.type) }}</td>
<td><a href="{{ edit_url }}">{{ item.name }}</a> {{ type_info(item.type) }}</td>
<td>{{ owner_info(item.owner) }}</td>
<td><span class="layui-badge layui-bg-gray">{{ item.user_count }}</span></td>
<td><input type="checkbox" name="published" value="1" lay-filter="published" lay-skin="switch" lay-text="是|否" data-url="{{ update_url }}" {% if item.published == 1 %}checked{% endif %}></td>
@ -63,6 +64,7 @@
<div class="layui-dropdown">
<button class="layui-btn layui-btn-sm">操作 <i class="layui-icon layui-icon-triangle-d"></i></button>
<ul>
<li><a href="{{ preview_url }}" target="_blank">预览</a></li>
<li><a href="{{ edit_url }}">编辑</a></li>
{% if item.deleted == 0 %}
<li><a href="javascript:" class="kg-delete" data-url="{{ delete_url }}">删除</a></li>

View File

@ -53,7 +53,8 @@
</div>
</div>
<div id="ptt-block" {{ ppt_display }}>
<table class="layui-table kg-table layui-form">
<div class="layui-form-item">
<table class="layui-table">
<colgroup>
<col>
<col>
@ -89,7 +90,7 @@
</tr>
</tbody>
</table>
<br>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label"></label>

View File

@ -32,7 +32,7 @@
<div class="layui-form-item">
<label class="layui-form-label">网站URL</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="base_url" value="{{ site.base_url }}">
<input class="layui-input" type="text" name="url" value="{{ site.url }}">
</div>
</div>
<div class="layui-form-item">

View File

@ -9,43 +9,58 @@
<div class="layui-form-item">
<label class="layui-form-label">空间名称</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="bucket_name" value="{{ storage.bucket_name }}" layui-verify="required">
<input class="layui-input" type="text" name="bucket" value="{{ cos.bucket }}" layui-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">所在区域</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="bucket_region" value="{{ storage.bucket_region }}" layui-verify="required">
<input class="layui-input" type="text" name="region" value="{{ cos.region }}" layui-verify="required">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">访问协议</label>
<div class="layui-input-block">
<input type="radio" name="bucket_protocol" value="http" title="HTTP" {% if storage.bucket_protocol == "http" %}checked{% endif %}>
<input type="radio" name="bucket_protocol" value="https" title="HTTPS" {% if storage.bucket_protocol == "https" %}checked{% endif %}>
<input type="radio" name="protocol" value="http" title="HTTP" {% if cos.protocol == "http" %}checked{% endif %}>
<input type="radio" name="protocol" value="https" title="HTTPS" {% if cos.protocol == "https" %}checked{% endif %}>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">访问域名</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="bucket_domain" value="{{ storage.bucket_domain }}" lay-verify="required">
<input class="layui-input" type="text" name="domain" value="{{ cos.domain }}" lay-verify="required">
</div>
</div>
<fieldset class="layui-elem-field layui-field-title">
<legend>数据万象</legend>
<legend>图片处理样式</legend>
</fieldset>
<div class="layui-form-item">
<label class="layui-form-label">访问协议</label>
<div class="layui-input-block">
<input type="radio" name="ci_protocol" value="http" title="HTTP" {% if storage.ci_protocol == "http" %}checked{% endif %}>
<input type="radio" name="ci_protocol" value="https" title="HTTPS" {% if storage.ci_protocol == "https" %}checked{% endif %}>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">访问域名</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="ci_domain" value="{{ storage.ci_domain }}" lay-verify="required">
</div>
<table class="layui-table" lay-size="lg">
<colgroup>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>样式名称</th>
<th>样式描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>avatar_160</td>
<td>imageMogr2/thumbnail/160x/interlace/0</td>
</tr>
<tr>
<td>cover_270</td>
<td>mageMogr2/thumbnail/270x/interlace/0</td>
</tr>
<tr>
<td>carousel_1100</td>
<td>imageMogr2/thumbnail/1100x/interlace/0</td>
</tr>
</tbody>
</table>
</div>
<div class="layui-form-item">
<label class="layui-form-label"></label>

View File

@ -25,7 +25,8 @@
<div class="layui-input-block">
<input type="radio" name="source_type" value="1" title="免费课程">
<input type="radio" name="source_type" value="2" title="付费课程">
<input type="radio" name="source_type" value="3" title="后台导入">
<input type="radio" name="source_type" value="3" title="畅学课程">
<input type="radio" name="source_type" value="4" title="后台导入">
</div>
</div>
<div class="layui-form-item">

View File

@ -1,35 +0,0 @@
<?php
namespace App\Http\Desktop\Controllers;
/**
* @RoutePrefix("/im")
*/
class ImSummaryController extends Controller
{
/**
* @Get("/active/groups", name="desktop.im.active_groups")
*/
public function activeGroupsAction()
{
$this->seo->prependTitle('群组');
}
/**
* @Get("/active/users", name="desktop.im.active_users")
*/
public function activeUsersAction()
{
$this->seo->prependTitle('群组');
}
/**
* @Get("/online/users", name="desktop.im.online_users")
*/
public function onlineUsersAction()
{
$this->seo->prependTitle('群组');
}
}

View File

@ -151,14 +151,14 @@ class MyController extends Controller
*/
public function groupsAction()
{
$type = $this->request->getQuery('type', 'trim', 'joined');
$scope = $this->request->getQuery('scope', 'trim', 'joined');
$service = new MyGroupListService();
$pager = $service->handle($type);
$pager = $service->handle($scope);
$this->view->pick('my/groups');
$this->view->setVar('type', $type);
$this->view->setVar('scope', $scope);
$this->view->setVar('pager', $pager);
}

View File

@ -32,7 +32,7 @@ class PublicController extends \Phalcon\Mvc\Controller
$service = new StorageService();
$location = $service->getCiImageUrl($file->path);
$location = $service->getImageUrl($file->path);
$this->response->redirect($location);

View File

@ -18,12 +18,15 @@ class UploadController extends Controller
{
$service = new StorageService();
$key = $service->uploadAvatarImage();
$file = $service->uploadAvatarImage();
$url = $service->getCiImageUrl($key);
if ($url) {
return $this->jsonSuccess(['data' => ['src' => $url, 'title' => '']]);
if ($file) {
return $this->jsonSuccess([
'data' => [
'src' => $service->getImageUrl($file->path),
'title' => $file->name,
]
]);
} else {
return $this->jsonError(['msg' => '上传文件失败']);
}

View File

@ -59,7 +59,7 @@ class Im extends Service
return [];
}
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$result = [];
@ -252,7 +252,7 @@ class Im extends Service
$users = $userRepo->findByIds($ids);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$mapping = [];
@ -303,7 +303,7 @@ class Im extends Service
$groups = $groupRepo->findByIds($ids);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$mapping = [];

View File

@ -7,6 +7,7 @@ use App\Builders\ImGroupUserList as ImGroupUserListBuilder;
use App\Caches\ImGroupActiveUserList as ImGroupActiveUserListCache;
use App\Library\Paginator\Query as PagerQuery;
use App\Models\ImGroup as ImGroupModel;
use App\Models\ImUser as ImUserModel;
use App\Repos\ImGroup as ImGroupRepo;
use App\Repos\ImGroupUser as ImGroupUserRepo;
use App\Repos\User as UserRepo;
@ -138,11 +139,17 @@ class ImGroup extends Service
$group = $validator->checkGroup($groupId);
$user = $validator->checkUser($userId);
$validator->checkOwner($loginUser->id, $group->owner_id);
$groupUser = $validator->checkGroupUser($groupId, $userId);
$groupUser->delete();
$this->decrGroupUserCount($group);
$this->decrUserGroupCount($user);
}
protected function handleGroupUsers($pager)
@ -181,7 +188,7 @@ class ImGroup extends Service
$users = $builder->getUsers($groups);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$items = [];
@ -207,4 +214,20 @@ class ImGroup extends Service
return $pager;
}
protected function decrGroupUserCount(ImGroupModel $group)
{
if ($group->user_count > 0) {
$group->user_count -= 1;
$group->update();
}
}
protected function decrUserGroupCount(ImUserModel $user)
{
if ($user->group_count > 0) {
$user->group_count -= 1;
$user->update();
}
}
}

View File

@ -45,7 +45,7 @@ Trait ImGroupTrait
$validator = new ImNoticeValidator();
$notice = $validator->checkNotice($noticeId, 'system');
$notice = $validator->checkNotice($noticeId);
if ($notice->item_type != ImNoticeModel::TYPE_GROUP_REQUEST) {
return;

View File

@ -1,3 +1,9 @@
{% set tc_val = request.get('tc','int','all') %}
{% set sc_val = request.get('sc','int','all') %}
{% set model_val = request.get('model','trim','all') %}
{% set level_val = request.get('level','trim','all') %}
{% set sort_val = request.get('sort','trim','score') %}
<div class="filter-toggle">
<span class="layui-icon layui-icon-up"></span>
</div>
@ -6,7 +12,6 @@
<div class="filter-group">
<div class="title">方向</div>
<div class="content">
{% set tc_val = request.get('tc','int','all') %}
{% for category in top_categories %}
{% set class = tc_val == category.id ? 'layui-btn layui-btn-xs' : 'none' %}
<a class="{{ class }}" href="{{ category.url }}">{{ category.name }}</a>
@ -17,7 +22,6 @@
<div class="filter-group">
<div class="title">分类</div>
<div class="content">
{% set sc_val = request.get('sc','int','all') %}
{% for category in sub_categories %}
{% set class = sc_val == category.id ? 'layui-btn layui-btn-xs' : 'none' %}
<a class="{{ class }}" href="{{ category.url }}">{{ category.name }}</a>
@ -28,7 +32,6 @@
<div class="filter-group">
<div class="title">类型</div>
<div class="content">
{% set model_val = request.get('model','trim','all') %}
{% for model in models %}
{% set class = model_val == model.id ? 'layui-btn layui-btn-xs' : 'none' %}
<a class="{{ class }}" href="{{ model.url }}">{{ model.name }}</a>
@ -38,7 +41,6 @@
<div class="filter-group">
<div class="title">难度</div>
<div class="content">
{% set level_val = request.get('level','trim','all') %}
{% for level in levels %}
{% set class = level_val == level.id ? 'layui-btn layui-btn-xs' : 'none' %}
<a class="{{ class }}" href="{{ level.url }}">{{ level.name }}</a>
@ -48,7 +50,6 @@
</div>
<div class="course-sort wrap">
{% set sort_val = request.get('sort','trim','score') %}
{% for sort in sorts %}
{% set class = sort_val == sort.id ? 'layui-btn layui-btn-xs' : 'none' %}
<a class="{{ class }}" href="{{ sort.url }}">{{ sort.name }}</a>

View File

@ -33,24 +33,24 @@
<p class="item">
<span class="key">难度级别</span><span class="value">{{ level_info(course.level) }}</span>
<span class="key">学习人次</span><span class="value">{{ course.user_count }}</span>
<span class="key">综合评分</span><span class="value">{{ course.ratings.rating }}</span>
<span class="key">综合评分</span><span class="value">{{ "%0.1f"|format(course.ratings.rating) }}</span>
</p>
</div>
<div class="rating">
<p class="item">
<span class="name">内容实用</span>
<span class="star">{{ star_info(course.ratings.rating1) }}</span>
<span class="score">{{ course.ratings.rating1 }}分</span>
<span class="score">{{ "%0.1f"|format(course.ratings.rating1) }}分</span>
</p>
<p class="item">
<span class="name">简洁易懂</span>
<span class="star">{{ star_info(course.ratings.rating2) }}</span>
<span class="score">{{ course.ratings.rating2 }}分</span>
<span class="score">{{ "%0.1f"|format(course.ratings.rating2) }}分</span>
</p>
<p class="item">
<span class="name">逻辑清晰</span>
<span class="star">{{ star_info(course.ratings.rating3) }}</span>
<span class="score">{{ course.ratings.rating3 }}分</span>
<span class="score">{{ "%0.1f"|format(course.ratings.rating3) }}分</span>
</p>
</div>
</div>

View File

@ -2,8 +2,8 @@
{% block content %}
{% set update_url = url({'for':'desktop.group.update','id':group.id}) %}
{% set name_readonly = group.type == 'course' ? 'readonly="readonly"' : '' %}
{% set update_url = url({'for':'desktop.igm.update','id':group.id}) %}
{% set name_readonly = group.type == 1 ? 'readonly="readonly"' : '' %}
<form class="layui-form" method="post" action="{{ update_url }}">
<div class="layui-form-item">

View File

@ -11,7 +11,7 @@
{{ type_info(item.type) }}
<div class="avatar">
<a href="{{ group_url }}" title="{{ item.about }}">
<img src="{{ item.avatar }}" alt="{{ item.name }}">
<img src="{{ item.avatar }}!avatar_160" alt="{{ item.name }}">
</a>
</div>
<div class="name layui-elip">

View File

@ -8,7 +8,7 @@
{{ type_info(group.type) }}
<div class="avatar">
<a href="{{ group_url }}" title="{{ group.about }}" target="group">
<img src="{{ group.avatar }}" alt="{{ group.name }}">
<img src="{{ group.avatar }}!avatar_160" alt="{{ group.name }}">
</a>
</div>
<div class="name layui-elip">

View File

@ -9,7 +9,7 @@
{{ vip_info(user.vip) }}
<div class="avatar">
<a href="{{ user_url }}" title="{{ user.about }}" target="user">
<img src="{{ user.avatar }}" alt="{{ user.name }}">
<img src="{{ user.avatar }}!avatar_160" alt="{{ user.name }}">
</a>
</div>
<div class="name layui-elip">

View File

@ -5,7 +5,7 @@
{% set sender = item_info.sender %}
{% set sender_url = url({'for':'desktop.user.show','id':sender.id}) %}
{% if item_type == '1' %}
{% if item_type == 1 %}
{% set group = item_info.group %}
{% set remark = item_info.remark ? '附言:' ~ item_info.remark : '' %}
<li data-id="{{ item.id }}">
@ -26,7 +26,7 @@
{% endif %}
</p>
</li>
{% elseif item_type == '2' %}
{% elseif item_type == 2 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>
@ -34,7 +34,7 @@
接受了你的好友申请<span>{{ item.create_time|time_ago }}</span>
</p>
</li>
{% elseif item_type == '3' %}
{% elseif item_type == 3 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>
@ -42,7 +42,7 @@
拒绝了你的好友申请<span>{{ item.create_time|time_ago }}</span>
</p>
</li>
{% elseif item_type == '4' %}
{% elseif item_type == 4 %}
{% set remark = item_info.remark ? '附言:' ~ item_info.remark : '' %}
<li data-id="{{ item.id }}">
<a href="{{ sender_url }}" target="_blank"><img class="layui-circle layim-msgbox-avatar" alt="{{ sender.name }}" src="{{ sender.avatar }}"></a>
@ -62,7 +62,7 @@
{% endif %}
</p>
</li>
{% elseif item_type == '5' %}
{% elseif item_type == 5 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>
@ -70,7 +70,7 @@
接受了你的入群申请<span>{{ item.create_time|time_ago }}</span>
</p>
</li>
{% elseif item_type == '6' %}
{% elseif item_type == 6 %}
<li class="layim-msgbox-system">
<p>
<em>系统:</em>

View File

@ -0,0 +1,9 @@
{%- macro priority_info(value) %}
{% if value == 10 %}
<span class="layui-badge layui-bg-red">高</span>
{% elseif value == 20 %}
<span class="layui-badge layui-bg-blue">中</span>
{% elseif value == 30 %}
<span class="layui-badge layui-bg-gray">低</span>
{% endif %}
{%- endmacro %}

View File

@ -1,9 +1,9 @@
{%- macro type_info(value) %}
{% if value == '1' %}
{% if value == 1 %}
<span class="layui-badge layui-bg-green type" title="课程交流">课</span>
{% elseif value == '2' %}
{% elseif value == 2 %}
<span class="layui-badge layui-bg-blue type" title="课外畅聊">聊</span>
{% elseif value == '3' %}
{% elseif value == 3 %}
<span class="layui-badge layui-bg-cyan type" title="职工交流">职</span>
{% endif %}
{%- endmacro %}

View File

@ -33,8 +33,8 @@
{% set delete_url = url({'for':'desktop.consult.delete','id':item.id}) %}
<tr>
<td>
<p class="layui-elip item-elip" title="{{ item.question }}">提问:{{ item.question }}</p>
<p class="layui-elip item-elip" title="{{ item.answer }}">回复:{{ item.answer }}</p>
<p class="content layui-elip" title="{{ item.question }}">提问:{{ item.question }}</p>
<p class="content layui-elip" title="{{ item.answer }}">回复:{{ item.answer }}</p>
</td>
<td>{{ date('Y-m-d',item.create_time) }}</td>
<td>

View File

@ -37,7 +37,7 @@
<td><a href="{{ course_url }}">{{ item.title }}</a> {{ model_info(item.model) }}</td>
<td>{{ item.user_count }}</td>
<td>{{ item.favorite_count }}</td>
<td>{{ item.rating }}</td>
<td>{{ "%0.1f"|format(item.rating) }}</td>
<td class="center">
<button class="layui-btn layui-btn-sm kg-delete" data-tips="确定要取消收藏吗?" data-url="{{ favorite_url }}">取消</button>
</td>

View File

@ -44,7 +44,7 @@
<tr>
<td><a href="{{ user_url }}" title="{{ item.about }}">{{ item.name }}</a></td>
<td>{{ gender_info(item.gender) }}</td>
<td>{{ item.location }}</td>
<td>{{ item.area }}</td>
<td>{{ item.active_time|time_ago }}</td>
<td>
<button class="layui-btn layui-btn-sm kg-delete" data-url="{{ delete_url }}">删除</button>

View File

@ -2,18 +2,12 @@
{% block content %}
{%- macro type_info(value) %}
{% if value == 'course' %}
<span class="layui-badge layui-bg-green">课</span>
{% elseif value == 'chat' %}
<span class="layui-badge layui-bg-blue">聊</span>
{% endif %}
{%- endmacro %}
{{ partial('macros/group') }}
{% set joined_url = url({'for':'desktop.my.groups'},{'type':'joined'}) %}
{% set owned_url = url({'for':'desktop.my.groups'},{'type':'owned'}) %}
{% set joined_class = type == 'joined' ? 'layui-btn layui-btn-xs' : 'none' %}
{% set owned_class = type == 'owned' ? 'layui-btn layui-btn-xs' : 'none' %}
{% set joined_url = url({'for':'desktop.my.groups'},{'scope':'joined'}) %}
{% set owned_url = url({'for':'desktop.my.groups'},{'scope':'owned'}) %}
{% set joined_class = scope == 'joined' ? 'layui-btn layui-btn-xs' : 'none' %}
{% set owned_class = scope == 'owned' ? 'layui-btn layui-btn-xs' : 'none' %}
<div class="layout-main">
<div class="my-sidebar">{{ partial('my/menu') }}</div>
@ -24,7 +18,7 @@
<a class="{{ owned_class }}" href="{{ owned_url }}">管理的</a>
</div>
<div class="my-group-wrap wrap">
{% if type == 'owned' %}
{% if scope == 'owned' %}
{{ partial('my/groups_owned') }}
{% else %}
{{ partial('my/groups_joined') }}

View File

@ -16,10 +16,11 @@
</thead>
<tbody>
{% for item in pager.items %}
{% set show_url = url({'for':'desktop.group.show','id':item.id}) %}
{% set owner_url = url({'for':'desktop.user.show','id':item.owner.id}) %}
{% set delete_url = url({'for':'desktop.im.quit_group','id':item.id}) %}
<tr>
<td><span title="{{ item.about }}">{{ item.name }}</span> {{ type_info(item.type) }}</td>
<td><a href="{{ show_url }}" title="{{ item.about }}">{{ item.name }}</a> {{ type_info(item.type) }}</td>
<td><a href="{{ owner_url }}">{{ item.owner.name }}</a></td>
<td>{{ item.user_count }}</td>
<td>

View File

@ -36,9 +36,9 @@
<p class="content layui-elip" title="{{ item.content }}">评价:{{ item.content }}</p>
</td>
<td>
<p class="rating">内容实用:{{ item.rating1 }}</p>
<p class="rating">通俗易懂:{{ item.rating2 }}</p>
<p class="rating">逻辑清晰:{{ item.rating3 }}</p>
<p class="rating">内容实用:{{ "%0.1f"|format(item.rating1) }}</p>
<p class="rating">通俗易懂:{{ "%0.1f"|format(item.rating2) }}</p>
<p class="rating">逻辑清晰:{{ "%0.1f"|format(item.rating3) }}</p>
</td>
<td>
<button class="layui-btn layui-btn-xs btn-edit-review" data-url="{{ edit_url }}">修改</button>

View File

@ -2,14 +2,14 @@
<div class="user-list teacher-list clearfix">
<div class="layui-row layui-col-space20">
{% for item in pager.items %}
{% set item.title = item.title ? item.title : '暂露头角' %}
{% set item.title = item.title ? item.title : '小小教书匠' %}
{% set item.about = item.about ? item.about : '这个人很懒,什么都没留下' %}
{% set user_url = url({'for':'desktop.teacher.show','id':item.id}) %}
<div class="layui-col-md2">
<div class="user-card">
<div class="avatar">
<a href="{{ user_url }}" title="{{ item.about }}">
<img src="{{ item.avatar }}" alt="{{ item.name }}">
<img src="{{ item.avatar }}!avatar_160" alt="{{ item.name }}">
</a>
</div>
<div class="name layui-elip">

View File

@ -2,6 +2,8 @@
{% block content %}
{{ partial('macros/consult') }}
{% set status_types = {'all':'全部','pending':'待回复','replied':'已回复'} %}
{% set status = request.get('status','trim','all') %}
@ -45,7 +47,7 @@
<p class="content layui-elip" title="{{ item.question }}">提问:{{ item.question }}</p>
<p class="content layui-elip" title="{{ item.answer }}">回复:{{ answer }}</p>
</td>
<td>{{ item.priority }}</td>
<td>{{ priority_info(item.priority) }}</td>
<td>{{ date('Y-m-d',item.create_time) }}</td>
<td>
<button class="layui-btn layui-btn-xs layui-bg-green btn-show-consult" data-url="{{ show_url }}">详情</button>

View File

@ -37,7 +37,7 @@
<td>{{ item.lesson_count }}</td>
<td>{{ item.user_count }}</td>
<td>{{ item.favorite_count }}</td>
<td>{{ item.rating }}</td>
<td>{{ "%0.1f"|format(item.rating) }}</td>
</tr>
{% endfor %}
</tbody>

View File

@ -12,7 +12,7 @@
{{ vip_info(item.vip) }}
<div class="avatar">
<a href="{{ user_url }}" title="{{ item.about }}">
<img src="{{ item.avatar }}" alt="{{ item.name }}">
<img src="{{ item.avatar }}!avatar_160" alt="{{ item.name }}">
</a>
</div>
<div class="name layui-elip">

View File

@ -121,7 +121,7 @@ function kg_ip2region($ip, $dbFile = null)
*
* @return string
*/
function kg_site_base_url()
function kg_site_url()
{
$scheme = filter_input(INPUT_SERVER, 'REQUEST_SCHEME');
$host = filter_input(INPUT_SERVER, 'HTTP_HOST');
@ -168,25 +168,25 @@ function kg_default_cover_path()
}
/**
* 获取数据万象基准URL
* 获取存储基准URL
*
* @return string
*/
function kg_ci_base_url()
function kg_ss_url()
{
$storage = new StorageService();
return $storage->getCiBaseUrl();
return $storage->getBaseUrl();
}
/**
* 获取数据万象URL
* 获取存储图片URL
*
* @param string $path
* @param string $style
* @return string
*/
function kg_ci_img_url($path, $style = null)
function kg_ss_img_url($path, $style = null)
{
if (!$path) return '';
@ -196,35 +196,35 @@ function kg_ci_img_url($path, $style = null)
$storage = new StorageService();
return $storage->getCiImageUrl($path, $style);
return $storage->getImageUrl($path, $style);
}
/**
* 获取头像数据万象URL
* 获取头像URL
*
* @param string $path
* @param string $style
* @return string
*/
function kg_ci_avatar_img_url($path, $style = null)
function kg_ss_avatar_url($path, $style = null)
{
$path = $path ?: kg_default_avatar_path();
return kg_ci_img_url($path, $style);
return kg_ss_img_url($path, $style);
}
/**
* 获取封面数据万象URL
* 获取封面URL
*
* @param string $path
* @param string $style
* @return string
*/
function kg_ci_cover_img_url($path, $style = null)
function kg_ss_cover_url($path, $style = null)
{
$path = $path ?: kg_default_cover_path();
return kg_ci_img_url($path, $style);
return kg_ss_img_url($path, $style);
}
/**
@ -432,7 +432,7 @@ function kg_full_url($uri, $args = null)
*/
$url = Di::getDefault()->getShared('url');
$baseUrl = kg_site_base_url();
$baseUrl = kg_site_url();
return $baseUrl . $url->get($uri, $args);
}

View File

@ -158,7 +158,7 @@ class Carousel extends Model
public function afterFetch()
{
if (!Text::startsWith($this->cover, 'http')) {
$this->cover = kg_ci_cover_img_url($this->cover);
$this->cover = kg_ss_cover_url($this->cover);
}
if (is_string($this->style) && !empty($this->style)) {

View File

@ -56,6 +56,13 @@ class Consult extends Model
*/
public $answer;
/**
* 评分
*
* @var int
*/
public $rating;
/**
* 优先级
*

View File

@ -338,7 +338,7 @@ class Course extends Model
$this->score = (float)$this->score;
if (!Text::startsWith($this->cover, 'http')) {
$this->cover = kg_ci_cover_img_url($this->cover);
$this->cover = kg_ss_cover_url($this->cover);
}
if (is_string($this->attrs) && !empty($this->attrs)) {

View File

@ -156,7 +156,7 @@ class ImGroup extends Model
public function afterFetch()
{
if (!Text::startsWith($this->avatar, 'http')) {
$this->avatar = kg_ci_avatar_img_url($this->avatar);
$this->avatar = kg_ss_avatar_url($this->avatar);
}
}

View File

@ -17,6 +17,13 @@ class ImNotice extends Model
const TYPE_GROUP_ACCEPTED = 5; // 入群被接受
const TYPE_GROUP_REFUSED = 6; // 入群被拒绝
/**
* 请求状态
*/
const REQUEST_PENDING = 'pending'; // 待定
const REQUEST_ACCEPTED = 'accepted'; // 接受
const REQUEST_REFUSED = 'refused'; // 拒绝
/**
* 主键编号
*

View File

@ -133,7 +133,7 @@ class ImUser extends Model
public function afterFetch()
{
if (!Text::startsWith($this->avatar, 'http')) {
$this->avatar = kg_ci_avatar_img_url($this->avatar);
$this->avatar = kg_ss_avatar_url($this->avatar);
}
}

View File

@ -221,7 +221,7 @@ class User extends Model
public function afterFetch()
{
if (!Text::startsWith($this->avatar, 'http')) {
$this->avatar = kg_ci_avatar_img_url($this->avatar);
$this->avatar = kg_ss_avatar_url($this->avatar);
}
}

View File

@ -46,8 +46,8 @@ class Volt extends Provider
return 'kg_js_include(' . $resolvedArgs . ')';
});
$compiler->addFunction('ci_img_url', function ($resolvedArgs) {
return 'kg_ci_img_url(' . $resolvedArgs . ')';
$compiler->addFunction('ss_img_url', function ($resolvedArgs) {
return 'kg_ss_img_url(' . $resolvedArgs . ')';
});
$compiler->addFunction('substr', function ($resolvedArgs) {

View File

@ -27,8 +27,8 @@ class ConsultInfo extends FrontendService
'id' => $consult->id,
'question' => $consult->question,
'answer' => $consult->answer,
'private' => $consult->private,
'rating' => $consult->rating,
'private' => $consult->private,
'like_count' => $consult->like_count,
'create_time' => $consult->create_time,
'update_time' => $consult->update_time,

View File

@ -57,7 +57,7 @@ class CourseList extends FrontendService
$items = [];
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
foreach ($courses as $course) {

View File

@ -1,24 +0,0 @@
<?php
namespace App\Services\Frontend\Im;
use App\Services\Frontend\Service as FrontendService;
use App\Validators\ImFriendUser as ImFriendUserValidator;
class ImFriendDelete extends FrontendService
{
public function handle($id)
{
$user = $this->getLoginUser();
$validator = new ImFriendUserValidator();
$friend = $validator->checkFriend($id);
$friendUser = $validator->checkFriendUser($user->id, $friend->id);
$friendUser->delete();
}
}

View File

@ -1,44 +0,0 @@
<?php
namespace App\Services\Frontend\Im;
use App\Models\ImGroup as ImGroupModel;
use App\Models\ImUser as ImUserModel;
use App\Services\Frontend\Service as FrontendService;
use App\Validators\ImGroupUser as ImGroupUserValidator;
class ImGroupDelete extends FrontendService
{
public function handle($id)
{
$user = $this->getLoginUser();
$validator = new ImGroupUserValidator();
$group = $validator->checkGroup($id);
$groupUser = $validator->checkGroupUser($group->id, $user->id);
$groupUser->delete();
$this->decrGroupUserCount($group);
}
protected function decrGroupUserCount(ImGroupModel $group)
{
if ($group->user_count > 0) {
$group->user_count -= 1;
$group->update();
}
}
protected function decrUserGroupCount(ImUserModel $user)
{
if ($user->group_count > 0) {
$user->group_count -= 1;
$user->update();
}
}
}

View File

@ -1,52 +0,0 @@
<?php
namespace App\Services\Frontend\Im;
use App\Models\ImGroup as ImGroupModel;
use App\Models\ImUser as ImUserModel;
use App\Services\Frontend\Service as FrontendService;
use App\Validators\ImGroupUser as ImGroupUserValidator;
class ImGroupUserDelete extends FrontendService
{
public function handle()
{
$post = $this->request->getPost();
$loginUser = $this->getLoginUser();
$validator = new ImGroupUserValidator();
$group = $validator->checkGroup($post['group_id']);
$user = $validator->checkUser($post['user_id']);
$validator->checkOwner($group->owner_id, $loginUser->id);
$groupUser = $validator->checkGroupUser($group->id, $user->id);
$groupUser->delete();
$this->decrGroupUserCount($group);
$this->decrUserGroupCount($user);
}
protected function decrGroupUserCount(ImGroupModel $group)
{
if ($group->user_count > 0) {
$group->user_count -= 1;
$group->update();
}
}
protected function decrUserGroupCount(ImUserModel $user)
{
if ($user->group_count > 0) {
$user->group_count -= 1;
$user->update();
}
}
}

View File

@ -11,13 +11,13 @@ use App\Services\Frontend\User\GroupList as UserGroupListService;
class GroupList extends FrontendService
{
public function handle($type)
public function handle($scope)
{
$result = [];
if ($type == 'joined') {
if ($scope == 'joined') {
$result = $this->handleJoinedGroups();
} elseif ($type == 'owned') {
} elseif ($scope == 'owned') {
$result = $this->handleOwnedGroups();
}
@ -62,7 +62,7 @@ class GroupList extends FrontendService
$users = $builder->getUsers($groups);
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$items = [];

View File

@ -17,7 +17,7 @@ class ProfileInfo extends FrontendService
protected function handleUser(UserModel $user)
{
$user->avatar = kg_ci_img_url($user->avatar);
$user->avatar = kg_ss_avatar_url($user->avatar);
$user->area = $this->handleArea($user->area);

View File

@ -91,14 +91,14 @@ class OrderInfo extends FrontendService
protected function handleCourseInfo($itemInfo)
{
$itemInfo['course']['cover'] = kg_ci_img_url($itemInfo['course']['cover']);
$itemInfo['course']['cover'] = kg_ss_cover_url($itemInfo['course']['cover']);
return $itemInfo;
}
protected function handlePackageInfo($itemInfo)
{
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
foreach ($itemInfo['courses'] as &$course) {
$course['cover'] = $baseUrl . $course['cover'];

View File

@ -40,7 +40,7 @@ class TeacherList extends FrontendService
$items = [];
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
foreach ($users as $user) {

View File

@ -33,7 +33,7 @@ class CourseList extends FrontendService
$items = [];
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
foreach ($pager->items->toArray() as $course) {

View File

@ -37,7 +37,7 @@ class CourseList extends FrontendService
$courses = $pager->items->toArray();
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$items = [];

View File

@ -37,7 +37,7 @@ class UserList extends FrontendService
$users = $pager->items->toArray();
$baseUrl = kg_ci_base_url();
$baseUrl = kg_ss_url();
$items = [];

View File

@ -45,6 +45,8 @@ class WxpayGateway extends Service
'mch_id' => $this->settings['mch_id'],
'key' => $this->settings['key'],
'notify_url' => $this->settings['notify_url'],
'cert_client' => '',
'cert_key' => '',
'log' => [
'file' => log_path('wxpay.log'),
'level' => $level,

View File

@ -32,7 +32,7 @@ class Refund extends Service
*/
$itemInfo = $order->item_info;
$itemInfo['course']['cover'] = kg_ci_cover_img_url($itemInfo['course']['cover']);
$itemInfo['course']['cover'] = kg_ss_cover_url($itemInfo['course']['cover']);
$refundPercent = 0.00;
$refundAmount = 0.00;
@ -72,7 +72,7 @@ class Refund extends Service
*/
foreach ($itemInfo['courses'] as &$course) {
$course['cover'] = kg_ci_cover_img_url($course['cover']);
$course['cover'] = kg_ss_cover_url($course['cover']);
$refundPercent = 0.00;
$refundAmount = 0.00;

View File

@ -25,7 +25,7 @@ class Storage extends Service
public function __construct()
{
$this->settings = $this->getSectionSettings('storage');
$this->settings = $this->getSectionSettings('cos');
$this->logger = $this->getLogger('storage');
@ -41,7 +41,7 @@ class Storage extends Service
*/
public function putString($key, $body)
{
$bucket = $this->settings['bucket_name'];
$bucket = $this->settings['bucket'];
try {
@ -52,7 +52,6 @@ class Storage extends Service
} catch (\Exception $e) {
$this->logger->error('Put String Exception ' . kg_json_encode([
'line' => $e->getLine(),
'code' => $e->getCode(),
'message' => $e->getMessage(),
]));
@ -72,7 +71,7 @@ class Storage extends Service
*/
public function putFile($key, $filename)
{
$bucket = $this->settings['bucket_name'];
$bucket = $this->settings['bucket'];
try {
@ -85,7 +84,6 @@ class Storage extends Service
} catch (\Exception $e) {
$this->logger->error('Put File Exception ' . kg_json_encode([
'line' => $e->getLine(),
'code' => $e->getCode(),
'message' => $e->getMessage(),
]));
@ -104,7 +102,7 @@ class Storage extends Service
*/
public function deleteObject($key)
{
$bucket = $this->settings['bucket_name'];
$bucket = $this->settings['bucket'];
try {
@ -118,7 +116,6 @@ class Storage extends Service
} catch (\Exception $e) {
$this->logger->error('Delete Object Exception ' . kg_json_encode([
'line' => $e->getLine(),
'code' => $e->getCode(),
'message' => $e->getMessage(),
]));
@ -130,52 +127,39 @@ class Storage extends Service
}
/**
* 获取存储桶文件URL
* 获取文件URL
*
* @param string $key
* @return string
*/
public function getBucketFileUrl($key)
public function getFileUrl($key)
{
return $this->getBucketBaseUrl() . $key;
return $this->getBaseUrl() . $key;
}
/**
* 获取数据万象图片URL
* 获取图片URL
*
* @param string $key
* @param string $style
* @return string
*/
public function getCiImageUrl($key, $style = null)
public function getImageUrl($key, $style = null)
{
$style = $style ?: '';
return $this->getCiBaseUrl() . $key . $style;
return $this->getBaseUrl() . $key . $style;
}
/**
* 获取存储桶根URL
* 获取基准URL
*
* @return string
*/
public function getBucketBaseUrl()
public function getBaseUrl()
{
$protocol = $this->settings['bucket_protocol'];
$domain = $this->settings['bucket_domain'];
return sprintf('%s://%s', $protocol, trim($domain, '/'));
}
/**
* 获取数据万象根URL
*
* @return string
*/
public function getCiBaseUrl()
{
$protocol = $this->settings['ci_protocol'];
$domain = $this->settings['ci_domain'];
$protocol = $this->settings['protocol'];
$domain = $this->settings['domain'];
return sprintf('%s://%s', $protocol, trim($domain, '/'));
}
@ -217,8 +201,8 @@ class Storage extends Service
$secret = $this->getSectionSettings('secret');
return new CosClient([
'region' => $this->settings['bucket_region'],
'schema' => $this->settings['bucket_protocol'],
'region' => $this->settings['region'],
'schema' => $this->settings['protocol'],
'credentials' => [
'secretId' => $secret['secret_id'],
'secretKey' => $secret['secret_key'],

View File

@ -9,7 +9,7 @@
"guzzlehttp/guzzle": "^6.3",
"swiftmailer/swiftmailer": "^6.0",
"peppeocchi/php-cron-scheduler": "^2.4",
"yansongda/pay": "^2.8",
"yansongda/pay": "^2.9",
"tencentcloud/tencentcloud-sdk-php": "3.*",
"qcloudsms/qcloudsms_php": "0.1.*",
"qcloud/cos-sdk-v5": "2.*",
@ -23,9 +23,8 @@
"lcobucci/jwt": "^3.3"
},
"require-dev": {
"phalcon/ide-stubs": "^3.4.3",
"jaeger/querylist": "^4.1",
"odan/phinx-migrations-generator": "^5.1"
"odan/phinx-migrations-generator": "^5.1",
"phalcon/ide-stubs": "^3.4"
},
"repositories": {
"packagist": {

625
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5c543936b37c657c151898d56a85a006",
"content-hash": "66628b38c16e2071e5636757472860e8",
"packages": [
{
"name": "aferrandini/phpqrcode",
@ -2622,16 +2622,16 @@
},
{
"name": "symfony/polyfill-php72",
"version": "v1.12.0",
"version": "v1.18.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "04ce3335667451138df4307d6a9b61565560199e"
"reference": "639447d008615574653fb3bc60d1986d7172eaae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/04ce3335667451138df4307d6a9b61565560199e",
"reference": "04ce3335667451138df4307d6a9b61565560199e",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
"reference": "639447d008615574653fb3bc60d1986d7172eaae",
"shasum": "",
"mirrors": [
{
@ -2646,7 +2646,11 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
"dev-master": "1.18-dev"
},
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
@ -2679,7 +2683,21 @@
"portable",
"shim"
],
"time": "2019-08-06T08:03:45+00:00"
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
"name": "symfony/polyfill-php73",
@ -3218,16 +3236,16 @@
},
{
"name": "yansongda/pay",
"version": "v2.8.6",
"version": "v2.9.5",
"source": {
"type": "git",
"url": "https://github.com/yansongda/pay.git",
"reference": "841999b65f97466ed1b405c52400c0c73aeaa3b5"
"reference": "0372c600eee2476df1b59912608edbf297a6582b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yansongda/pay/zipball/841999b65f97466ed1b405c52400c0c73aeaa3b5",
"reference": "841999b65f97466ed1b405c52400c0c73aeaa3b5",
"url": "https://api.github.com/repos/yansongda/pay/zipball/0372c600eee2476df1b59912608edbf297a6582b",
"reference": "0372c600eee2476df1b59912608edbf297a6582b",
"shasum": "",
"mirrors": [
{
@ -3237,16 +3255,18 @@
]
},
"require": {
"ext-bcmath": "*",
"ext-json": "*",
"ext-libxml": "*",
"ext-openssl": "*",
"ext-simplexml": "*",
"php": ">=7.1.3",
"symfony/event-dispatcher": "^4.0",
"symfony/http-foundation": "^4.0",
"symfony/event-dispatcher": "^4.0 || ^5.0",
"symfony/http-foundation": "^4.0 || ^5.0.7",
"yansongda/supports": "^2.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^7.5"
},
@ -3272,7 +3292,7 @@
"pay",
"wechat"
],
"time": "2019-09-21T15:05:57+00:00"
"time": "2020-07-03T03:46:09+00:00"
},
{
"name": "yansongda/supports",
@ -3337,445 +3357,6 @@
}
],
"packages-dev": [
{
"name": "cache/adapter-common",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/php-cache/adapter-common.git",
"reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-cache/adapter-common/zipball/6320bb5f5574cb88438059b59f8708da6b6f1d32",
"reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"cache/tag-interop": "^1.0",
"php": "^5.6 || ^7.0",
"psr/cache": "^1.0",
"psr/log": "^1.0",
"psr/simple-cache": "^1.0"
},
"require-dev": {
"cache/integration-tests": "^0.16",
"phpunit/phpunit": "^5.7.21"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Cache\\Adapter\\Common\\": ""
}
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Aaron Scherer",
"email": "aequasi@gmail.com",
"homepage": "https://github.com/aequasi"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
}
],
"description": "Common classes for PSR-6 adapters",
"homepage": "http://www.php-cache.com/en/latest/",
"keywords": [
"cache",
"psr-6",
"tag"
],
"time": "2018-07-08T13:04:33+00:00"
},
{
"name": "cache/filesystem-adapter",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-cache/filesystem-adapter.git",
"reference": "d50680b6dabbe39f9831f5fc9efa61c09d936017"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-cache/filesystem-adapter/zipball/d50680b6dabbe39f9831f5fc9efa61c09d936017",
"reference": "d50680b6dabbe39f9831f5fc9efa61c09d936017",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"cache/adapter-common": "^1.0",
"league/flysystem": "^1.0",
"php": "^5.6 || ^7.0",
"psr/cache": "^1.0",
"psr/simple-cache": "^1.0"
},
"provide": {
"psr/cache-implementation": "^1.0"
},
"require-dev": {
"cache/integration-tests": "^0.16",
"phpunit/phpunit": "^5.7.21"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Cache\\Adapter\\Filesystem\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Aaron Scherer",
"email": "aequasi@gmail.com",
"homepage": "https://github.com/aequasi"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
}
],
"description": "A PSR-6 cache implementation using filesystem. This implementation supports tags",
"homepage": "http://www.php-cache.com/en/latest/",
"keywords": [
"cache",
"filesystem",
"psr-6",
"tag"
],
"time": "2017-07-16T21:09:25+00:00"
},
{
"name": "cache/tag-interop",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-cache/tag-interop.git",
"reference": "c7496dd81530f538af27b4f2713cde97bc292832"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-cache/tag-interop/zipball/c7496dd81530f538af27b4f2713cde97bc292832",
"reference": "c7496dd81530f538af27b4f2713cde97bc292832",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^5.5 || ^7.0",
"psr/cache": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"Cache\\TagInterop\\": ""
}
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com",
"homepage": "https://github.com/nicolas-grekas"
}
],
"description": "Framework interoperable interfaces for tags",
"homepage": "http://www.php-cache.com/en/latest/",
"keywords": [
"cache",
"psr",
"psr6",
"tag"
],
"time": "2017-03-13T09:14:27+00:00"
},
{
"name": "jaeger/g-http",
"version": "V1.6.0",
"source": {
"type": "git",
"url": "https://github.com/jae-jae/GHttp.git",
"reference": "eb34d266a07c687aef45087370ef47d48321bd2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jae-jae/GHttp/zipball/eb34d266a07c687aef45087370ef47d48321bd2e",
"reference": "eb34d266a07c687aef45087370ef47d48321bd2e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"cache/filesystem-adapter": "^1.0",
"guzzlehttp/guzzle": "^6.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Jaeger\\": "src"
}
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jaeger",
"email": "JaegerCode@gmail.com"
}
],
"description": "Simple Http client base on GuzzleHttp",
"time": "2018-12-12T04:21:15+00:00"
},
{
"name": "jaeger/phpquery-single",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/jae-jae/phpQuery-single.git",
"reference": "2d607a2bcfd8bcf5c42e83d6c66fedaf397c7c3f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jae-jae/phpQuery-single/zipball/2d607a2bcfd8bcf5c42e83d6c66fedaf397c7c3f",
"reference": "2d607a2bcfd8bcf5c42e83d6c66fedaf397c7c3f",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"classmap": [
"phpQuery.php"
]
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Tobiasz Cudnik",
"email": "tobiasz.cudnik@gmail.com",
"homepage": "https://github.com/TobiaszCudnik",
"role": "Developer"
},
{
"name": "Jaeger",
"role": "Packager"
}
],
"description": "phpQuery单文件版本是Querylist的依赖(http://querylist.cc/)phpQuery项目主页:http://code.google.com/p/phpquery/",
"homepage": "http://code.google.com/p/phpquery/",
"time": "2019-02-22T07:27:45+00:00"
},
{
"name": "jaeger/querylist",
"version": "V4.1.1",
"source": {
"type": "git",
"url": "https://github.com/jae-jae/QueryList.git",
"reference": "46f564bc8b1a22b5dca7cd690b4af76e919b39f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jae-jae/QueryList/zipball/46f564bc8b1a22b5dca7cd690b4af76e919b39f7",
"reference": "46f564bc8b1a22b5dca7cd690b4af76e919b39f7",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"jaeger/g-http": "^1.1",
"jaeger/phpquery-single": "^1",
"php": ">=7.0",
"tightenco/collect": "^5"
},
"require-dev": {
"phpunit/phpunit": "^7.5",
"symfony/var-dumper": "^3.3"
},
"type": "library",
"autoload": {
"psr-4": {
"QL\\": "src"
}
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jaeger",
"email": "JaegerCode@gmail.com"
}
],
"description": "Simple, elegant, extensible PHP Web Scraper (crawler/spider),Use the css3 dom selector,Based on phpQuery! 简洁、优雅、可扩展的PHP采集工具(爬虫)基于phpQuery。",
"homepage": "http://querylist.cc",
"keywords": [
"QueryList",
"phpQuery",
"spider"
],
"time": "2019-02-22T07:33:54+00:00"
},
{
"name": "league/flysystem",
"version": "1.0.63",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "8132daec326565036bc8e8d1876f77ec183a7bd6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8132daec326565036bc8e8d1876f77ec183a7bd6",
"reference": "8132daec326565036bc8e8d1876f77ec183a7bd6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"ext-fileinfo": "*",
"php": ">=5.5.9"
},
"conflict": {
"league/flysystem-sftp": "<1.0.6"
},
"require-dev": {
"phpspec/phpspec": "^3.4",
"phpunit/phpunit": "^5.7.10"
},
"suggest": {
"ext-fileinfo": "Required for MimeType",
"ext-ftp": "Allows you to use FTP server storage",
"ext-openssl": "Allows you to use FTPS server storage",
"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2",
"league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",
"league/flysystem-azure": "Allows you to use Windows Azure Blob storage",
"league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching",
"league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem",
"league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files",
"league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib",
"league/flysystem-webdav": "Allows you to use WebDAV storage",
"league/flysystem-ziparchive": "Allows you to use ZipArchive adapter",
"spatie/flysystem-dropbox": "Allows you to use Dropbox storage",
"srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"League\\Flysystem\\": "src/"
}
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Filesystem abstraction: Many filesystems, one API.",
"keywords": [
"Cloud Files",
"WebDAV",
"abstraction",
"aws",
"cloud",
"copy.com",
"dropbox",
"file systems",
"files",
"filesystem",
"filesystems",
"ftp",
"rackspace",
"remote",
"s3",
"sftp",
"storage"
],
"time": "2020-01-04T16:30:31+00:00"
},
{
"name": "odan/phinx-migrations-generator",
"version": "5.1.2",
@ -3946,144 +3527,6 @@
"variable"
],
"time": "2018-07-03T12:46:23+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v4.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/be330f919bdb395d1e0c3f2bfb8948512d6bdd99",
"reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.1.3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/polyfill-php72": "~1.5"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
"symfony/console": "<3.4"
},
"require-dev": {
"ext-iconv": "*",
"symfony/console": "^3.4|^4.0|^5.0",
"symfony/process": "^4.4|^5.0",
"twig/twig": "^1.34|^2.4|^3.0"
},
"suggest": {
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
"ext-intl": "To show region name in time zone dump",
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
},
"bin": [
"Resources/bin/var-dump-server"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.4-dev"
}
},
"autoload": {
"files": [
"Resources/functions/dump.php"
],
"psr-4": {
"Symfony\\Component\\VarDumper\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony mechanism for exploring and dumping PHP variables",
"homepage": "https://symfony.com",
"keywords": [
"debug",
"dump"
],
"time": "2019-12-18T13:41:29+00:00"
},
{
"name": "tightenco/collect",
"version": "v5.8.35",
"source": {
"type": "git",
"url": "https://github.com/tightenco/collect.git",
"reference": "c93a7039e6207ad533a09109838fe80933fcc72c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tightenco/collect/zipball/c93a7039e6207ad533a09109838fe80933fcc72c",
"reference": "c93a7039e6207ad533a09109838fe80933fcc72c",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.1.3",
"symfony/var-dumper": ">=3.4 <5"
},
"require-dev": {
"mockery/mockery": "^1.0",
"nesbot/carbon": "^1.26.3",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"autoload": {
"files": [
"src/Collect/Support/helpers.php",
"src/Collect/Support/alias.php"
],
"psr-4": {
"Tightenco\\Collect\\": "src/Collect"
}
},
"notification-url": "https://packagist.jp/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
}
],
"description": "Collect - Illuminate Collections as a separate package.",
"keywords": [
"collection",
"laravel"
],
"time": "2019-09-17T18:57:01+00:00"
}
],
"aliases": [],

View File

@ -10,6 +10,11 @@ final class InsertSettingData extends AbstractMigration
public function up()
{
$rows = [
[
'section' => 'captcha',
'item_key' => 'enabled',
'item_value' => '0',
],
[
'section' => 'captcha',
'item_key' => 'app_id',
@ -21,7 +26,7 @@ final class InsertSettingData extends AbstractMigration
'item_value' => '',
],
[
'section' => 'captcha',
'section' => 'im.cs',
'item_key' => 'enabled',
'item_value' => '0',
],
@ -32,8 +37,8 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'im.cs',
'item_key' => 'enabled',
'item_value' => '0',
'item_key' => 'user2_id',
'item_value' => '',
],
[
'section' => 'im.cs',
@ -41,20 +46,15 @@ final class InsertSettingData extends AbstractMigration
'item_value' => '',
],
[
'section' => 'im.cs',
'item_key' => 'user2_id',
'item_value' => '',
'section' => 'im.main',
'item_key' => 'title',
'item_value' => '菜鸟驿站',
],
[
'section' => 'im.main',
'item_key' => 'msg_max_length',
'item_value' => '1000',
],
[
'section' => 'im.main',
'item_key' => 'title',
'item_value' => '菜鸟驿站',
],
[
'section' => 'im.main',
'item_key' => 'upload_img_enabled',
@ -82,52 +82,52 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'live.push',
'item_key' => 'push_auth_enabled',
'item_key' => 'auth_enabled',
'item_value' => '1',
],
[
'section' => 'live.push',
'item_key' => 'push_auth_key',
'item_key' => 'auth_key',
'item_value' => '',
],
[
'section' => 'live.push',
'item_key' => 'push_auth_delta',
'item_key' => 'auth_delta',
'item_value' => '18000',
],
[
'section' => 'live.pull',
'item_key' => 'pull_protocol',
'item_key' => 'protocol',
'item_value' => 'http',
],
[
'section' => 'live.pull',
'item_key' => 'pull_domain',
'item_key' => 'domain',
'item_value' => '',
],
[
'section' => 'live.pull',
'item_key' => 'pull_trans_enabled',
'item_key' => 'trans_enabled',
'item_value' => '0',
],
[
'section' => 'live.pull',
'item_key' => 'pull_auth_enabled',
'item_key' => 'auth_enabled',
'item_value' => '1',
],
[
'section' => 'live.pull',
'item_key' => 'pull_auth_key',
'item_key' => 'auth_key',
'item_value' => '',
],
[
'section' => 'live.pull',
'item_key' => 'pull_auth_delta',
'item_key' => 'auth_delta',
'item_value' => '18000',
],
[
'section' => 'live.notify',
'item_key' => 'pull_auth_key',
'item_key' => 'auth_key',
'item_value' => '',
],
[
@ -170,6 +170,11 @@ final class InsertSettingData extends AbstractMigration
'item_key' => 'smtp_encryption',
'item_value' => 'ssl',
],
[
'section' => 'mailer',
'item_key' => 'smtp_authentication',
'item_value' => '1',
],
[
'section' => 'mailer',
'item_key' => 'smtp_username',
@ -191,10 +196,15 @@ final class InsertSettingData extends AbstractMigration
'item_value' => 'ABC有限公司',
],
[
'section' => 'mailer',
'item_key' => 'smtp_authentication',
'section' => 'pay.alipay',
'item_key' => 'enabled',
'item_value' => '1',
],
[
'section' => 'pay.alipay',
'item_key' => 'app_id',
'item_value' => '',
],
[
'section' => 'pay.alipay',
'item_key' => 'public_key',
@ -207,34 +217,19 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'pay.alipay',
'item_key' => 'return_url',
'item_value' => '',
],
[
'section' => 'pay.alipay',
'item_key' => 'notify_url',
'item_value' => '',
],
[
'section' => 'pay.wxpay',
'item_key' => 'enabled',
'item_value' => '1',
],
[
'section' => 'pay.alipay',
'item_key' => 'return_url',
'item_value' => '',
],
[
'section' => 'pay.alipay',
'item_key' => 'notify_url',
'item_value' => '',
],
[
'section' => 'pay.alipay',
'item_key' => 'app_id',
'item_value' => '',
],
[
'section' => 'pay.wxpay',
'item_key' => 'notify_url',
'item_value' => '',
],
[
'section' => 'pay.wxpay',
'item_key' => 'return_url',
'item_value' => '',
],
[
'section' => 'pay.wxpay',
'item_key' => 'app_id',
@ -252,8 +247,13 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'pay.wxpay',
'item_key' => 'enabled',
'item_value' => '1',
'item_key' => 'notify_url',
'item_value' => '',
],
[
'section' => 'pay.wxpay',
'item_key' => 'return_url',
'item_value' => '',
],
[
'section' => 'secret',
@ -270,6 +270,11 @@ final class InsertSettingData extends AbstractMigration
'item_key' => 'app_id',
'item_value' => '',
],
[
'section' => 'site',
'item_key' => 'title',
'item_value' => '酷瓜云课堂',
],
[
'section' => 'site',
'item_key' => 'keywords',
@ -277,9 +282,29 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'site',
'item_key' => 'analytics',
'item_key' => 'description',
'item_value' => '酷瓜云课堂依托腾讯云基础服务使用C扩展框架PHALCON开发',
],
[
'section' => 'site',
'item_key' => 'url',
'item_value' => '',
],
[
'section' => 'site',
'item_key' => 'enabled',
'item_value' => '1',
],
[
'section' => 'site',
'item_key' => 'closed_tips',
'item_value' => '站点维护中,请稍后再访问。',
],
[
'section' => 'site',
'item_key' => 'copyright',
'item_value' => '2016-2020 深圳市酷瓜软件有限公司',
],
[
'section' => 'site',
'item_key' => 'icp_sn',
@ -302,34 +327,9 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'site',
'item_key' => 'copyright',
'item_value' => '2016-2020 深圳市酷瓜软件有限公司',
],
[
'section' => 'site',
'item_key' => 'base_url',
'item_key' => 'analytics',
'item_value' => '',
],
[
'section' => 'site',
'item_key' => 'enabled',
'item_value' => '1',
],
[
'section' => 'site',
'item_key' => 'closed_tips',
'item_value' => '站点维护中,请稍后再访问。',
],
[
'section' => 'site',
'item_key' => 'description',
'item_value' => '酷瓜云课堂依托腾讯云基础服务使用C扩展框架PHALCON开发',
],
[
'section' => 'site',
'item_key' => 'title',
'item_value' => '酷瓜云课堂',
],
[
'section' => 'smser',
'item_key' => 'app_id',
@ -337,8 +337,8 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'smser',
'item_key' => 'template',
'item_value' => '{"verify":{"id":"561282","content":"验证码:{1}{2} 分钟内有效,如非本人操作请忽略。"},"order":{"id":"561954","content":"下单成功,商品名称:{1},订单序号:{2},订单金额:¥{3}"},"refund":{"id":"561286","content":"退款成功,商品名称:{1},订单序号:{2},退款金额:¥{3}"},"live":{"id":"561288","content":"直播预告,课程名称:{1},章节名称:{2},开播时间:{3}"}}',
'item_key' => 'app_key',
'item_value' => '',
],
[
'section' => 'smser',
@ -347,64 +347,29 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'smser',
'item_key' => 'app_key',
'item_key' => 'template',
'item_value' => '{"verify":{"id":"561282","content":"验证码:{1}{2} 分钟内有效,如非本人操作请忽略。"},"order":{"id":"561954","content":"下单成功,商品名称:{1},订单序号:{2},订单金额:¥{3}"},"refund":{"id":"561286","content":"退款成功,商品名称:{1},订单序号:{2},退款金额:¥{3}"},"live":{"id":"561288","content":"直播预告,课程名称:{1},章节名称:{2},开播时间:{3}"}}',
],
[
'section' => 'cos',
'item_key' => 'bucket',
'item_value' => '',
],
[
'section' => 'storage',
'item_key' => 'ci_protocol',
'section' => 'cos',
'item_key' => 'region',
'item_value' => '',
],
[
'section' => 'cos',
'item_key' => 'protocol',
'item_value' => 'https',
],
[
'section' => 'storage',
'item_key' => 'bucket_name',
'section' => 'cos',
'item_key' => 'domain',
'item_value' => '',
],
[
'section' => 'storage',
'item_key' => 'ci_domain',
'item_value' => '',
],
[
'section' => 'storage',
'item_key' => 'bucket_region',
'item_value' => '',
],
[
'section' => 'storage',
'item_key' => 'bucket_protocol',
'item_value' => 'https',
],
[
'section' => 'storage',
'item_key' => 'bucket_domain',
'item_value' => '',
],
[
'section' => 'vod',
'item_key' => 'dist_protocol',
'item_value' => 'https',
],
[
'section' => 'vod',
'item_key' => 'watermark_enabled',
'item_value' => '1',
],
[
'section' => 'vod',
'item_key' => 'watermark_template',
'item_value' => '462027',
],
[
'section' => 'vod',
'item_key' => 'audio_format',
'item_value' => 'mp3',
],
[
'section' => 'vod',
'item_key' => 'video_format',
'item_value' => 'hls',
],
[
'section' => 'vod',
'item_key' => 'storage_type',
@ -417,14 +382,39 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'vod',
'item_key' => 'key_anti_ip_limit',
'item_value' => '',
'item_key' => 'audio_format',
'item_value' => 'mp3',
],
[
'section' => 'vod',
'item_key' => 'video_format',
'item_value' => 'hls',
],
[
'section' => 'vod',
'item_key' => 'watermark_enabled',
'item_value' => '1',
],
[
'section' => 'vod',
'item_key' => 'watermark_template',
'item_value' => '462027',
],
[
'section' => 'vod',
'item_key' => 'dist_protocol',
'item_value' => 'https',
],
[
'section' => 'vod',
'item_key' => 'dist_domain',
'item_value' => '',
],
[
'section' => 'vod',
'item_key' => 'key_anti_enabled',
'item_value' => '1',
],
[
'section' => 'vod',
'item_key' => 'key_anti_key',
@ -437,8 +427,8 @@ final class InsertSettingData extends AbstractMigration
],
[
'section' => 'vod',
'item_key' => 'key_anti_enabled',
'item_value' => '1',
'item_key' => 'key_anti_ip_limit',
'item_value' => '',
],
];

View File

@ -73,6 +73,7 @@
}
.pager {
margin-top: 20px;
text-align: center;
}