From 844ffdcabd4b9061b5526e45b0612c83840c538f Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 19 Aug 2021 10:07:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestingResourceController.class.php | 6 +++ .../Tool/GameResource/LeyouClient.class.php | 10 +++- .../Tool/GameResource/LsxxClient.class.php | 4 ++ .../Tool/GameResource/SbcqClient.class.php | 7 +-- .../Tool/GameResource/XyyClient.class.php | 7 +-- .../Tool/GameResource/YzchzbClient.class.php | 4 ++ Application/Base/Tool/Log.class.php | 54 +++++++++++++++++++ 7 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 Application/Base/Tool/Log.class.php diff --git a/Application/Admin/Controller/TestingResourceController.class.php b/Application/Admin/Controller/TestingResourceController.class.php index 6faf72c8c..edd749dcc 100644 --- a/Application/Admin/Controller/TestingResourceController.class.php +++ b/Application/Admin/Controller/TestingResourceController.class.php @@ -10,6 +10,7 @@ use Base\Service\PartnerService; use Base\Repository\TestingResourceRepository; use Base\Repository\GameRepository; use Base\Service\GameService; +use Base\Tool\Log; class TestingResourceController extends ThinkController { @@ -530,6 +531,11 @@ class TestingResourceController extends ThinkController { $ids = I('ids', []); $status = I('status', 0); + + $admin = session('user_auth'); + Log::info('admin_provide ' . $admin['username'] . ' -- ' . implode(',', $ids) . ' -- ' . $status); + return $this->ajaxReturn(['status' => 0, 'message' => '手动发放暂时关闭']); + if (count($ids) == 0) { return $this->ajaxReturn(['status' => 0, 'message' => '请选择要审核的批次']); } diff --git a/Application/Base/Tool/GameResource/LeyouClient.class.php b/Application/Base/Tool/GameResource/LeyouClient.class.php index 3158f8844..a44529181 100644 --- a/Application/Base/Tool/GameResource/LeyouClient.class.php +++ b/Application/Base/Tool/GameResource/LeyouClient.class.php @@ -2,6 +2,7 @@ namespace Base\Tool\GameResource; +use Base\Tool\Log; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; @@ -41,6 +42,7 @@ class LeyouClient return $this->request($api, $params); } catch (\Exception $e) { $env = C('APP_ENV', null, 'prod'); + Log::error('Leyou ' . $e->getMessage()); return $e->getMessage(); } } @@ -60,7 +62,9 @@ class LeyouClient 'verify' => false, 'form_params' => $params, ]); - return (string)$response->getBody(); + $result = (string)$response->getBody(); + Log::info('Leyou ' . json_encode($params) . ' ' . $result); + return $result; } protected function get($uri, array $params = []) @@ -69,7 +73,9 @@ class LeyouClient 'verify' => false, 'query' => $params, ]); - return (string)$response->getBody(); + $result = (string)$response->getBody(); + Log::info('Leyou ' . json_encode($params) . ' ' . $result); + return $result; } protected function sign($params) diff --git a/Application/Base/Tool/GameResource/LsxxClient.class.php b/Application/Base/Tool/GameResource/LsxxClient.class.php index 733ee7595..057d4b875 100644 --- a/Application/Base/Tool/GameResource/LsxxClient.class.php +++ b/Application/Base/Tool/GameResource/LsxxClient.class.php @@ -2,6 +2,7 @@ namespace Base\Tool\GameResource; +use Base\Tool\Log; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; @@ -39,6 +40,7 @@ class LsxxClient return $this->request($api, $params); } catch (\Exception $e) { $env = C('APP_ENV', null, 'prod'); + Log::error('Lsxx ' . $e->getMessage()); return ['status' => 0, 'msg' => '接口请求错误。' . ($env == 'prod' ? '' : $e->getMessage()) , 'data' => []]; } } @@ -59,6 +61,7 @@ class LsxxClient 'form_params' => $params, ]); $result = (string)$response->getBody(); + Log::info('Lsxx ' . json_encode($params) . ' ' . $result); return json_decode($result, true); } @@ -69,6 +72,7 @@ class LsxxClient 'query' => $params, ]); $result = (string)$response->getBody(); + Log::info('Lsxx ' . json_encode($params) . ' ' . $result); return json_decode($result, true); } diff --git a/Application/Base/Tool/GameResource/SbcqClient.class.php b/Application/Base/Tool/GameResource/SbcqClient.class.php index 412439fde..2b8a59fe3 100644 --- a/Application/Base/Tool/GameResource/SbcqClient.class.php +++ b/Application/Base/Tool/GameResource/SbcqClient.class.php @@ -2,9 +2,9 @@ namespace Base\Tool\GameResource; +use Base\Tool\Log; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; -use Think\Log; /** * 双倍传奇-测试资源接口 @@ -42,6 +42,7 @@ class SbcqClient return $this->request($api, $params); } catch (\Exception $e) { $env = C('APP_ENV', null, 'prod'); + Log::error('rebate:SBCQ ' . $e->getMessage()); return ['status' => 'error', 'msg' => '接口请求错误。' . ($env == 'prod' ? '' : $e->getMessage()) , 'data' => []]; } } @@ -62,7 +63,7 @@ class SbcqClient 'form_params' => $params, ]); $result = (string)$response->getBody(); - Log::record('rebate:SBCQ ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); + Log::info('rebate:SBCQ ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); return json_decode($result, true); } @@ -73,7 +74,7 @@ class SbcqClient 'query' => $params, ]); $result = (string)$response->getBody(); - Log::record('rebate:SBCQ ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); + Log::info('rebate:SBCQ ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); return json_decode($result, true); } diff --git a/Application/Base/Tool/GameResource/XyyClient.class.php b/Application/Base/Tool/GameResource/XyyClient.class.php index 1895f879e..8304023f0 100644 --- a/Application/Base/Tool/GameResource/XyyClient.class.php +++ b/Application/Base/Tool/GameResource/XyyClient.class.php @@ -2,9 +2,9 @@ namespace Base\Tool\GameResource; +use Base\Tool\Log; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; -use Think\Log; /** * 逍遥游之仙魔降世-测试资源接口 @@ -43,6 +43,7 @@ class XyyClient return $this->request($api, $params); } catch (\Exception $e) { $env = C('APP_ENV', null, 'prod'); + Log::error('rebate:XYY ' . $e->getMessage()); return ['code' => 3, 'msg' => '接口请求错误。' . ($env == 'prod' ? '' : $e->getMessage()) , 'data' => []]; } } @@ -63,7 +64,7 @@ class XyyClient 'form_params' => $params, ]); $result = (string)$response->getBody(); - Log::record('rebate:XYY ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); + Log::info('rebate:XYY ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); return json_decode($result, true); } @@ -74,7 +75,7 @@ class XyyClient 'query' => $params, ]); $result = (string)$response->getBody(); - Log::record('rebate:XYY ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); + Log::info('rebate:XYY ' . $uri . ' -- '. json_encode($params) . ' -- '. $result); return json_decode($result, true); } diff --git a/Application/Base/Tool/GameResource/YzchzbClient.class.php b/Application/Base/Tool/GameResource/YzchzbClient.class.php index 1efb656ec..a5832d35a 100644 --- a/Application/Base/Tool/GameResource/YzchzbClient.class.php +++ b/Application/Base/Tool/GameResource/YzchzbClient.class.php @@ -2,6 +2,7 @@ namespace Base\Tool\GameResource; +use Base\Tool\Log; use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; @@ -57,6 +58,7 @@ class YzchzbClient return $this->request($api, $params); } catch (\Exception $e) { $env = C('APP_ENV', null, 'prod'); + Log::error($e->getMessage()); return ['code' => 1000, 'state' => 1000, 'message' => '接口请求错误。' . ($env == 'prod' ? '' : $e->getMessage()) , 'data' => []]; } } @@ -77,6 +79,7 @@ class YzchzbClient 'form_params' => $params, ]); $result = (string)$response->getBody(); + Log::info(json_encode($params) . ' ' . $result); return json_decode($result, true); } @@ -87,6 +90,7 @@ class YzchzbClient 'query' => $params, ]); $result = (string)$response->getBody(); + Log::info(json_encode($params) . ' ' . $result); return json_decode($result, true); } diff --git a/Application/Base/Tool/Log.class.php b/Application/Base/Tool/Log.class.php new file mode 100644 index 000000000..cce8fe15a --- /dev/null +++ b/Application/Base/Tool/Log.class.php @@ -0,0 +1,54 @@ +