Update sys.php

This commit is contained in:
Anyon 2019-11-11 14:13:55 +08:00
parent 970ac320b0
commit d6c83c4c5b

View File

@ -46,10 +46,9 @@ if (!function_exists('sysoplog')) {
$app = app();
return $app->db->name('SystemOplog')->insert([
'node' => \think\admin\service\NodeService::instance($app)->getCurrent(),
'geoip' => PHP_SAPI === 'cli' ? '127.0.0.1' : $app->request->ip(),
'action' => $action,
'content' => $content,
'username' => PHP_SAPI === 'cli' ? 'cli' : $app->session->get('user.username'),
'geoip' => $app->request->isCli() ? '127.0.0.1' : $app->request->ip(),
'action' => $action, 'content' => $content,
'username' => $app->request->isCli() ? 'cli' : $app->session->get('user.username', ''),
]);
}
}