Commit ff6fc8ba authored by Administrator's avatar Administrator

Merge branch '0911_app_operate_log_optimize_qjk' into 'master'

操作人 ID 和 操作人名称取值兼容

See merge request !5
parents 02863d7d b0070261
...@@ -115,10 +115,16 @@ class AppOperateLogService ...@@ -115,10 +115,16 @@ class AppOperateLogService
string $remark = '' string $remark = ''
): bool ): bool
{ {
$user = [];
try {
$user = Auth::user();
} catch (\Exception $e) {
//报错直接忽略
}
return $this->addOperateLog( return $this->addOperateLog(
make(RequestInterface::class)->header('hwq-request-id', ''), make(RequestInterface::class)->header('hwq-request-id', ''),
Auth::id() ?? 0, !empty($param['operator_user_id']) ? $param['operator_user_id'] : ($user['id'] ?? 0),
Auth::user()['name'] ?? '', !empty($param['operator_user_name']) ? $param['operator_user_name'] : ($user['name'] ?? ''),
$this->getClientIp(), $this->getClientIp(),
make(RequestInterface::class)->url(), make(RequestInterface::class)->url(),
$tableName, $tableName,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment