日志记录

This commit is contained in:
2024-12-04 10:30:52 +08:00
parent 85b3b5802a
commit aa7d93feaa
3 changed files with 3 additions and 0 deletions

View File

@@ -119,6 +119,7 @@ class JsonResponseFormatter extends \yii\web\JsonResponseFormatter
self::$param['result'] = [];
self::$param['url'] = Yii::$app->request->getUrl();
self::$param['type'] = $response->statusCode == 200? 0: 1;
self::$param['result_code'] = $errcode;
$op = get_device_type();
self::$param['ip'] = $op['ip'];
self::$param['equipment'] = $op['platform'];

View File

@@ -34,6 +34,7 @@ class LogJob extends BaseJob implements JobInterface
$opLogModel->user_id = $param['user_id'];
$opLogModel->url = $param['url'];
$opLogModel->type = $param['type'];
$opLogModel->result_code = $param['result_code'];
$opLogModel->ip = $param['ip'];
$opLogModel->param = json_encode($param['param']);
$opLogModel->result = json_encode($param['result']);

View File

@@ -11,6 +11,7 @@ use Yii;
* @property string|int user_id //操作用户ID
* @property string|int url // 操作路由
* @property string|int type // 操作状态 0成功 1失败
* @property string|int result_code // 返回的状态码
* @property string|int ip // 操作者IP地址
* @property string|int param // 操作者IP地址
* @property string|int result // 操作者IP地址