mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-22 03:32:47 +08:00
整理代码
This commit is contained in:
parent
aa239924a8
commit
7e94b95c05
@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Console\Tasks;
|
||||
|
||||
use App\Caches\Setting as SettingCache;
|
||||
use App\Library\Cache\Backend\Redis as RedisCache;
|
||||
use App\Models\Setting as SettingModel;
|
||||
use Phalcon\Cli\Task;
|
||||
use Phalcon\Config;
|
||||
|
||||
@ -11,11 +13,31 @@ class MaintainTask extends Task
|
||||
|
||||
public function mainAction()
|
||||
{
|
||||
$this->resetSettingAction();
|
||||
$this->resetAnnotationAction();
|
||||
$this->resetMetadataAction();
|
||||
$this->resetVoltAction();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置设置
|
||||
*
|
||||
* @command: php console.php maintain reset_setting
|
||||
*/
|
||||
public function resetSettingAction()
|
||||
{
|
||||
echo "start reset setting..." . PHP_EOL;
|
||||
|
||||
$rows = SettingModel::query()->columns('section')->distinct(true)->execute();
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$cache = new SettingCache();
|
||||
$cache->rebuild($row->section);
|
||||
}
|
||||
|
||||
echo "end reset setting..." . PHP_EOL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置注解
|
||||
*
|
||||
@ -38,7 +60,7 @@ class MaintainTask extends Task
|
||||
|
||||
if (count($keys) > 0) {
|
||||
|
||||
$keys = $this->handleKeys($keys);
|
||||
$keys = $this->handlePhKeys($keys);
|
||||
|
||||
$redis->del(...$keys);
|
||||
$redis->del($statsKey);
|
||||
@ -69,7 +91,7 @@ class MaintainTask extends Task
|
||||
|
||||
if (count($keys) > 0) {
|
||||
|
||||
$keys = $this->handleKeys($keys);
|
||||
$keys = $this->handlePhKeys($keys);
|
||||
|
||||
$redis->del(...$keys);
|
||||
$redis->del($statsKey);
|
||||
@ -118,7 +140,7 @@ class MaintainTask extends Task
|
||||
return $cache;
|
||||
}
|
||||
|
||||
protected function handleKeys($keys)
|
||||
protected function handlePhKeys($keys)
|
||||
{
|
||||
return array_map(function ($key) {
|
||||
return "_PHCR{$key}";
|
||||
|
@ -14,11 +14,11 @@ class VodController extends Controller
|
||||
/**
|
||||
* @Post("/upload/sign", name="admin.vod.upload_sign")
|
||||
*/
|
||||
public function uploadSignAction()
|
||||
public function uploadSignatureAction()
|
||||
{
|
||||
$service = new VodService();
|
||||
|
||||
$sign = $service->getUploadSign();
|
||||
$sign = $service->getUploadSignature();
|
||||
|
||||
return $this->jsonSuccess(['sign' => $sign]);
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{% set free = course.market_price == 0 %}
|
||||
{% set price_display = course.market_price > 0 ? 'display:block' : 'display:none' %}
|
||||
|
||||
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.course.update','id':course.id}) }}">
|
||||
<div class="layui-form-item">
|
||||
@ -8,7 +9,7 @@
|
||||
<input type="radio" name="price_mode" value="charge" title="收费" lay-filter="price_mode" {% if not free %}checked="checked"{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="price-block" {% if free %}style="display:none;"{% endif %}>
|
||||
<div id="price-block" style="{{ price_display }}">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">市场价格</label>
|
||||
|
@ -52,7 +52,7 @@
|
||||
});
|
||||
|
||||
form.on('radio(pull_trans_enabled)', function (data) {
|
||||
var block = $('#ptt-block');
|
||||
var block = $('#pull-trans-tpl-block');
|
||||
if (data.value === '1') {
|
||||
block.show();
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
{% set auth_display = pull.auth_enabled == 0 ? 'style="display:none;"' : '' %}
|
||||
{% set ppt_display = pull.trans_enabled == 0 ? 'style="display:none;"' : '' %}
|
||||
{% set pull_auth_display = pull.auth_enabled == 1 ? 'display:block' : 'display:none' %}
|
||||
{% set pull_trans_tpl_display = pull.trans_enabled == 1 ? 'display:block' : 'display:none' %}
|
||||
|
||||
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.live'}) }}">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
@ -28,7 +28,7 @@
|
||||
<input type="radio" name="auth_enabled" value="0" title="否" lay-filter="pull_auth_enabled" {% if pull.auth_enabled == 0 %}checked{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="pull-auth-block" {{ auth_display }}>
|
||||
<div id="pull-auth-block" style="{{ pull_auth_display }}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">鉴权密钥</label>
|
||||
<div class="layui-input-block">
|
||||
@ -52,7 +52,7 @@
|
||||
<input type="radio" name="trans_enabled" value="0" title="否" lay-filter="pull_trans_enabled" {% if pull.trans_enabled == 0 %}checked{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ptt-block" {{ ppt_display }}>
|
||||
<div id="pull-trans-tpl-block" style="{{ pull_trans_tpl_display }}">
|
||||
<div class="layui-form-item">
|
||||
<table class="layui-table">
|
||||
<colgroup>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% set auth_display = push.auth_enabled == 0 ? 'style="display:none;"' : '' %}
|
||||
{% set push_auth_display = push.auth_enabled == 1 ? 'display:block' : 'display:none' %}
|
||||
|
||||
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.live'}) }}">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
@ -16,11 +16,11 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">开启鉴权</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="auth_enabled" value="1" title="是" lay-filter="auth_enabled" {% if push.auth_enabled == 1 %}checked{% endif %}>
|
||||
<input type="radio" name="auth_enabled" value="0" title="否" lay-filter="auth_enabled" {% if push.auth_enabled == 0 %}checked{% endif %}>
|
||||
<input type="radio" name="auth_enabled" value="1" title="是" lay-filter="push_auth_enabled" {% if push.auth_enabled == 1 %}checked{% endif %}>
|
||||
<input type="radio" name="auth_enabled" value="0" title="否" lay-filter="push_auth_enabled" {% if push.auth_enabled == 0 %}checked{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="push-auth-block" {{ auth_display }}>
|
||||
<div id="push-auth-block" style="{{ push_auth_display }}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">鉴权密钥</label>
|
||||
<div class="layui-input-block">
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% set closed_tips_display = site.enabled == 1 ? 'style="display:none;"' : '' %}
|
||||
{% set closed_tips_display = site.enabled == 0 ? 'display:block' : 'display:none' %}
|
||||
|
||||
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.site'}) }}">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
@ -15,7 +15,7 @@
|
||||
<input type="radio" name="enabled" value="0" title="关闭" lay-filter="status" {% if site.enabled == 0 %}checked{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="closed-tips-block" {{ closed_tips_display }}>
|
||||
<div id="closed-tips-block" style="{{ closed_tips_display }}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关闭原因</label>
|
||||
<div class="layui-input-block">
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% set storage_region_display = vod.storage_type == 'nearby' ? 'style="display:none;"' : '' %}
|
||||
{% set watermark_tpl_display = vod.watermark_enabled == 0 ? 'style="display:none;"' : '' %}
|
||||
{% set key_anti_display = vod.key_anti_enabled == 0 ? 'style="display:none;"' : '' %}
|
||||
{% set storage_region_display = vod.storage_type == 'fixed' ? 'display:block' : 'display:none' %}
|
||||
{% set watermark_template_display = vod.watermark_enabled == 1 ? 'display:block' : 'display:none' %}
|
||||
{% set key_anti_display = vod.key_anti_enabled == 1 ? 'display:block': 'display:none' %}
|
||||
|
||||
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.setting.vod'}) }}">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
@ -17,7 +17,7 @@
|
||||
<input type="radio" name="storage_type" value="fixed" title="固定区域" lay-filter="storage_type" {% if vod.storage_type == "fixed" %}checked{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="storage-region-block" {{ storage_region_display }}>
|
||||
<div id="storage-region-block" style="{{ storage_region_display }}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">所在区域</label>
|
||||
<div class="layui-input-block">
|
||||
@ -49,7 +49,7 @@
|
||||
<input type="radio" name="watermark_enabled" value="0" title="否" lay-filter="watermark_enabled" {% if vod.watermark_enabled == 0 %}checked{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div id="watermark-template-block" {{ watermark_tpl_display }}>
|
||||
<div id="watermark-template-block" style="{{ watermark_template_display }}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">水印模板ID</label>
|
||||
<div class="layui-input-block">
|
||||
@ -63,14 +63,14 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分发协议</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="dist_protocol" value="https" title="HTTPS" {% if vod.dist_protocol == "https" %}checked{% endif %}>
|
||||
<input type="radio" name="dist_protocol" value="http" title="HTTP" {% if vod.dist_protocol == "http" %}checked{% endif %}>
|
||||
<input type="radio" name="protocol" value="https" title="HTTPS" {% if vod.protocol == "https" %}checked{% endif %}>
|
||||
<input type="radio" name="protocol" value="http" title="HTTP" {% if vod.protocol == "http" %}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="dist_domain" value="{{ vod.dist_domain }}" lay-verify="required">
|
||||
<input class="layui-input" type="text" name="domain" value="{{ vod.domain }}" lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% set lock_expiry_display = user.locked == 1 ? 'display:block': 'display:none' %}
|
||||
|
||||
<form class="layui-form kg-form" method="POST" action="{{ url({'for':'admin.user.update','id':user.id}) }}">
|
||||
<fieldset class="layui-elem-field layui-field-title">
|
||||
<legend>编辑用户</legend>
|
||||
@ -51,14 +53,16 @@
|
||||
<input type="radio" name="locked" value="0" title="否" lay-filter="locked" {% if user.locked == 0 %}checked="checked"{% endif %}>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" id="lock-expiry-block" {% if user.locked == 0 %}style="display:none;"{% endif %}>
|
||||
<label class="layui-form-label">锁定期限</label>
|
||||
<div class="layui-input-block">
|
||||
{% if user.lock_expiry_time > 0 %}
|
||||
<input class="layui-input" type="text" name="lock_expiry_time" autocomplete="off" value="{{ date('Y-m-d H:i:s',user.lock_expiry_time) }}">
|
||||
{% else %}
|
||||
<input class="layui-input" type="text" name="lock_expiry_time" autocomplete="off">
|
||||
{% endif %}
|
||||
<div id="lock-expiry-block" style="{{ lock_expiry_display }}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">锁定期限</label>
|
||||
<div class="layui-input-block">
|
||||
{% if user.lock_expiry_time > 0 %}
|
||||
<input class="layui-input" type="text" name="lock_expiry_time" autocomplete="off" value="{{ date('Y-m-d H:i:s',user.lock_expiry_time) }}">
|
||||
{% else %}
|
||||
<input class="layui-input" type="text" name="lock_expiry_time" autocomplete="off">
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
|
@ -84,7 +84,7 @@ class Vod extends Service
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUploadSign()
|
||||
public function getUploadSignature()
|
||||
{
|
||||
$secret = $this->getSectionSettings('secret');
|
||||
|
||||
|
2
config/cert/alipay/.gitignore
vendored
Normal file
2
config/cert/alipay/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
2
config/cert/wxpay/.gitignore
vendored
Normal file
2
config/cert/wxpay/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
@ -402,12 +402,12 @@ final class InsertSettingData extends AbstractMigration
|
||||
],
|
||||
[
|
||||
'section' => 'vod',
|
||||
'item_key' => 'dist_protocol',
|
||||
'item_key' => 'protocol',
|
||||
'item_value' => 'https',
|
||||
],
|
||||
[
|
||||
'section' => 'vod',
|
||||
'item_key' => 'dist_domain',
|
||||
'item_key' => 'domain',
|
||||
'item_value' => '',
|
||||
],
|
||||
[
|
||||
|
Loading…
x
Reference in New Issue
Block a user