1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-17 15:55:31 +08:00

1.增加log.trace日志配置

2.migration抽象增加saveSetting方法
This commit is contained in:
xiaochong0302 2024-08-13 09:27:26 +08:00
parent 3a703dd0e1
commit d5353ff5d2
6 changed files with 39 additions and 19 deletions

View File

@ -1,6 +1,13 @@
### [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)

View File

@ -7,11 +7,29 @@
namespace App\Console\Migrations;
use App\Models\Setting as SettingModel;
use App\Repos\Setting as SettingRepo;
use App\Traits\Service as ServiceTrait;
abstract class Migration
{
use ServiceTrait;
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);
}
}
}

View File

@ -56,19 +56,4 @@ class Admin extends AuthService
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;
}
}

View File

@ -33,9 +33,12 @@ class ConsoleErrorHandler extends Injectable
$config = $this->getConfig();
if ($config->get('env') == 'dev') {
$trace = sprintf('%sTrace Content: %s', PHP_EOL, $e->getTraceAsString());
if ($config->path('env') == 'dev' || $config->path('log.trace')) {
$trace = sprintf('Trace Content: %s', $e->getTraceAsString());
$logger->error($trace);
$content .= $trace;
}

View File

@ -77,8 +77,10 @@ class HttpErrorHandler extends Injectable
$config = $this->getConfig();
if ($config->get('env') == 'dev') {
if ($config->path('env') == 'dev' || $config->path('log.trace')) {
$content = sprintf('Trace Content: %s', $e->getTraceAsString());
$logger->error($content);
}
}

View File

@ -27,6 +27,11 @@ $config['timezone'] = 'Asia/Shanghai';
*/
$config['log']['level'] = Phalcon\Logger::INFO;
/**
* 日志链路
*/
$config['log']['trace'] = false;
/**
* 网站根地址,必须以"/"结尾
*/