feat: complete logging coverage - all services + frontend route fix
Backend additions: - UserConnectService, ScanConnectService: connection logging - ToBetCommonService, ToBetBaccaratService: bet rejection/success logging - ResetBoot, ResetNumberTab, ResetBaccarat, ResetDt: reset event logging - handle/Index: log_report controller method (fixes route for dealer端) - index/Log: log_report controller for player端 (no auth required) Frontend: - error-report.js: fix report URL to /index/log_report (matches handle controller) Total: 21 backend files with 60 Logger calls across 5 categories
This commit is contained in:
@@ -65,6 +65,24 @@ class Index extends Common{
|
||||
//View::assign('localSbServer',Env::get('system.SB_SERVER'));
|
||||
View::assign('localSbServer', $tableInfo['media_near_rtmp']); // 无用的字段来作为本地识别设备IP
|
||||
}
|
||||
public function log_report(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json(['status' => 0]);
|
||||
$data = Request::instance()->post();
|
||||
\app\utils\Logger::error(\app\utils\Logger::CAT_FRONTEND, $data['message'] ?? 'unknown', [
|
||||
'source' => $data['source'] ?? 'unknown',
|
||||
'type' => $data['type'] ?? 'error',
|
||||
'stack' => isset($data['stack']) ? substr($data['stack'], 0, 2000) : '',
|
||||
'file' => $data['file'] ?? '',
|
||||
'url' => $data['url'] ?? '',
|
||||
'line' => $data['line'] ?? '',
|
||||
'col' => $data['col'] ?? '',
|
||||
'ua' => Request::instance()->header('user-agent', ''),
|
||||
'ip' => Request::instance()->ip(),
|
||||
]);
|
||||
return json(['status' => 1]);
|
||||
}
|
||||
|
||||
function get_lang(): Json
|
||||
{
|
||||
if (!Request::instance()->isPost()) return json();
|
||||
|
||||
Reference in New Issue
Block a user