fix request log
This commit is contained in:
@@ -6,7 +6,6 @@ namespace App\Controller\Api\V1;
|
||||
|
||||
use App\Controller\AbstractController;
|
||||
use App\Middleware\AuthMiddleware;
|
||||
use App\Middleware\RequestLogMiddleware;
|
||||
use App\Model\User;
|
||||
use App\Service\OperationLogService;
|
||||
use Carbon\Carbon;
|
||||
@@ -260,7 +259,7 @@ class AuthController extends AbstractController
|
||||
target_type: 'user',
|
||||
target_id: $user->id,
|
||||
description: "用户 {$user->username} 登录",
|
||||
ip: RequestLogMiddleware::getClientIp($request),
|
||||
ip: OperationLogService::getRequestIp(),
|
||||
);
|
||||
|
||||
return [
|
||||
|
||||
@@ -240,7 +240,7 @@ class DataScopeController extends AbstractController
|
||||
$this->scopeTableManager->rebuildUserScope($id);
|
||||
|
||||
OperationLogService::log(
|
||||
user_id: OperationLogService::getCurrentUserId() ?? 0,
|
||||
user_id: OperationLogService::getCurrentUserId(),
|
||||
action: 'scope.update',
|
||||
target_type: 'user',
|
||||
target_id: $id,
|
||||
|
||||
@@ -174,7 +174,7 @@ class RoleController extends AbstractController
|
||||
$target_user->load('role');
|
||||
|
||||
OperationLogService::log(
|
||||
user_id: OperationLogService::getCurrentUserId() ?? 0,
|
||||
user_id: OperationLogService::getCurrentUserId(),
|
||||
action: 'role.update',
|
||||
target_type: 'user',
|
||||
target_id: $id,
|
||||
|
||||
@@ -232,7 +232,7 @@ class UserController extends AbstractController
|
||||
]);
|
||||
|
||||
OperationLogService::log(
|
||||
user_id: OperationLogService::getCurrentUserId() ?? 0,
|
||||
user_id: OperationLogService::getCurrentUserId(),
|
||||
action: 'user.create',
|
||||
target_type: 'user',
|
||||
target_id: $user->id,
|
||||
@@ -442,7 +442,7 @@ class UserController extends AbstractController
|
||||
$user->refresh();
|
||||
|
||||
OperationLogService::log(
|
||||
user_id: OperationLogService::getCurrentUserId() ?? 0,
|
||||
user_id: OperationLogService::getCurrentUserId(),
|
||||
action: 'user.update',
|
||||
target_type: 'user',
|
||||
target_id: $user->id,
|
||||
@@ -531,7 +531,7 @@ class UserController extends AbstractController
|
||||
$user->refresh();
|
||||
|
||||
OperationLogService::log(
|
||||
user_id: OperationLogService::getCurrentUserId() ?? 0,
|
||||
user_id: OperationLogService::getCurrentUserId(),
|
||||
action: 'user.status_change',
|
||||
target_type: 'user',
|
||||
target_id: $user->id,
|
||||
|
||||
Reference in New Issue
Block a user