|
@@ -368,28 +368,23 @@ class Apic
|
|
$controllername = $this->request->controller();
|
|
$controllername = $this->request->controller();
|
|
$actionname = $this->request->action();
|
|
$actionname = $this->request->action();
|
|
|
|
|
|
- if($controllername == 'Notify'){
|
|
|
|
- return true;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
$data = [
|
|
$data = [
|
|
'uid' => $this->auth->id,
|
|
'uid' => $this->auth->id,
|
|
'api' => $modulename.'/'.$controllername.'/'.$actionname,
|
|
'api' => $modulename.'/'.$controllername.'/'.$actionname,
|
|
- 'params_get' => json_encode($this->request->input()),
|
|
|
|
- 'params_post' => json_encode($this->request->post()),
|
|
|
|
- 'params_request' => json_encode($this->request->request()),
|
|
|
|
-// 'addtime' => time(),
|
|
|
|
|
|
+ 'params' => json_encode($this->request->request()),
|
|
|
|
+ 'addtime' => time(),
|
|
'adddatetime' => date('Y-m-d H:i:s'),
|
|
'adddatetime' => date('Y-m-d H:i:s'),
|
|
'ip' => request()->ip(),
|
|
'ip' => request()->ip(),
|
|
];
|
|
];
|
|
$request_id = db('api_request_log')->insertGetId($data);
|
|
$request_id = db('api_request_log')->insertGetId($data);
|
|
defined('API_REQUEST_ID') or define('API_REQUEST_ID', $request_id);
|
|
defined('API_REQUEST_ID') or define('API_REQUEST_ID', $request_id);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
protected function request_log_update($log_result){
|
|
protected function request_log_update($log_result){
|
|
if(defined('API_REQUEST_ID')) { //记录app正常返回结果
|
|
if(defined('API_REQUEST_ID')) { //记录app正常返回结果
|
|
if(strlen(json_encode($log_result['data'])) > 10000) {
|
|
if(strlen(json_encode($log_result['data'])) > 10000) {
|
|
- // $log_result['data'] = '数据太多,不记录';
|
|
|
|
|
|
+ $log_result['data'] = '数据太多,不记录';
|
|
}
|
|
}
|
|
db('api_request_log')->where('id',API_REQUEST_ID)->update(['result'=>json_encode($log_result)]);
|
|
db('api_request_log')->where('id',API_REQUEST_ID)->update(['result'=>json_encode($log_result)]);
|
|
}
|
|
}
|