Commit b0070261 authored by qinjunkun's avatar qinjunkun

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

parent 02863d7d
...@@ -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