Commit 737186b3 authored by shajiaiming's avatar shajiaiming

fix

parent e724499f
......@@ -25,31 +25,42 @@ class OperationLogInterceptor extends ActionFilter
// if (!isset(Yii::$app->params['handleTableAndDesc']['handleTableAndDesc'][$handerClass][$handlerAction][$method])) {
// return false;
// }
if ('asset' == $handerClass) {
$uri = Yii::$app->request->post('uri', '');
if (isset(Yii::$app->params['handleTableAndDesc']['handleTableAndDesc'][$handerClass][$handlerAction][$uri])) {
$params = [
'ip' => Yii::$app->request->userIP,
'operation' => '操作',
'business' => Yii::$app->params['handleTableAndDesc']['handleTableAndDesc'][$handerClass][$handlerAction][$uri] ?? $handerClass . '-' . $handlerAction,
'table' => 'asset'
];
}
} else {
switch ($method) {
case "get":
$operation = '查询';
break;
case 'post':
$operation = '增加';
break;
case 'put':
$operation = '更新';
break;
case 'delete':
$operation = '删除';
break;
default:
$operation = '未知';
}
switch ($method) {
case "get":
$operation = '查询';
break;
case 'post':
$operation = '增加';
break;
case 'put':
$operation = '更新';
break;
case 'delete':
$operation = '删除';
break;
default:
$operation = '未知';
$params = [
'ip' => Yii::$app->request->userIP,
'operation' => $operation,
'business' => Yii::$app->params['handleTableAndDesc']['handleTableAndDesc'][$handerClass][$handlerAction][$method] ?? $handerClass . '-' . $handlerAction,
'table' => Yii::$app->params['handleTableAndDesc']['handleTableAndDesc'][$handerClass][$handlerAction]['table'] ?? '未知'
];
}
$params = [
'ip' => Yii::$app->request->userIP,
'operation' => $operation,
'business' => Yii::$app->params['handleTableAndDesc']['handleTableAndDesc'][$handerClass][$handlerAction][$method] ?? $handerClass . '-' . $handlerAction,
'table' => Yii::$app->params['handleTableAndDesc']['handleTableAndDesc'][$handerClass][$handlerAction]['table'] ?? '未知'
];
$token_string = Yii::$app->request->headers->get('Token');
$curl = new Curl();
......
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