mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-28 21:31:37 +08:00
1.增加log.trace日志配置
2.migration抽象增加saveSetting方法
This commit is contained in:
parent
3a703dd0e1
commit
d5353ff5d2
@ -1,6 +1,13 @@
|
|||||||
### [v1.7.2](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.2)(2024-07-31)
|
### [v1.7.2](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.2)(2024-07-31)
|
||||||
|
|
||||||
|
- 更新layui-v2.9.14
|
||||||
|
- 优化docker自动化脚本
|
||||||
|
- 修正教师直播通知
|
||||||
|
- 修正课程分类删选问题
|
||||||
|
- 后台增加客户服务入口
|
||||||
|
- redis增加expire方法
|
||||||
|
- 日志记录增加log.trace参数
|
||||||
|
- 精简代码
|
||||||
|
|
||||||
### [v1.7.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.1)(2024-06-31)
|
### [v1.7.1](https://gitee.com/koogua/course-tencent-cloud/releases/v1.7.1)(2024-06-31)
|
||||||
|
|
||||||
|
@ -7,11 +7,29 @@
|
|||||||
|
|
||||||
namespace App\Console\Migrations;
|
namespace App\Console\Migrations;
|
||||||
|
|
||||||
|
use App\Models\Setting as SettingModel;
|
||||||
|
use App\Repos\Setting as SettingRepo;
|
||||||
use App\Traits\Service as ServiceTrait;
|
use App\Traits\Service as ServiceTrait;
|
||||||
|
|
||||||
abstract class Migration
|
abstract class Migration
|
||||||
{
|
{
|
||||||
|
|
||||||
use ServiceTrait;
|
use ServiceTrait;
|
||||||
|
|
||||||
abstract public function run();
|
abstract public function run();
|
||||||
|
|
||||||
|
protected function saveSetting(array $setting)
|
||||||
|
{
|
||||||
|
$settingRepo = new SettingRepo();
|
||||||
|
|
||||||
|
$item = $settingRepo->findItem($setting['section'], $setting['item_key']);
|
||||||
|
|
||||||
|
if (!$item) {
|
||||||
|
$item = new SettingModel();
|
||||||
|
$item->create($setting);
|
||||||
|
} else {
|
||||||
|
$item->update($setting);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -56,19 +56,4 @@ class Admin extends AuthService
|
|||||||
return 'admin_auth_info';
|
return 'admin_auth_info';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasPermission($route)
|
|
||||||
{
|
|
||||||
$authUser = $this->getAuthInfo();
|
|
||||||
|
|
||||||
if ($authUser['root'] == 1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_array($route, $authUser['routes'])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,12 @@ class ConsoleErrorHandler extends Injectable
|
|||||||
|
|
||||||
$config = $this->getConfig();
|
$config = $this->getConfig();
|
||||||
|
|
||||||
if ($config->get('env') == 'dev') {
|
if ($config->path('env') == 'dev' || $config->path('log.trace')) {
|
||||||
$trace = sprintf('%sTrace Content: %s', PHP_EOL, $e->getTraceAsString());
|
|
||||||
|
$trace = sprintf('Trace Content: %s', $e->getTraceAsString());
|
||||||
|
|
||||||
$logger->error($trace);
|
$logger->error($trace);
|
||||||
|
|
||||||
$content .= $trace;
|
$content .= $trace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,8 +77,10 @@ class HttpErrorHandler extends Injectable
|
|||||||
|
|
||||||
$config = $this->getConfig();
|
$config = $this->getConfig();
|
||||||
|
|
||||||
if ($config->get('env') == 'dev') {
|
if ($config->path('env') == 'dev' || $config->path('log.trace')) {
|
||||||
|
|
||||||
$content = sprintf('Trace Content: %s', $e->getTraceAsString());
|
$content = sprintf('Trace Content: %s', $e->getTraceAsString());
|
||||||
|
|
||||||
$logger->error($content);
|
$logger->error($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,11 @@ $config['timezone'] = 'Asia/Shanghai';
|
|||||||
*/
|
*/
|
||||||
$config['log']['level'] = Phalcon\Logger::INFO;
|
$config['log']['level'] = Phalcon\Logger::INFO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志链路
|
||||||
|
*/
|
||||||
|
$config['log']['trace'] = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网站根地址,必须以"/"结尾
|
* 网站根地址,必须以"/"结尾
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user