From c01b0f108311d7278a960b33f2bad5a5afc59c02 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 15 Jan 2020 15:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E7=9F=AD=E4=BF=A1=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0ip=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/PublicController.class.php | 2 +- Application/Base/Tool/TaskClient.class.php | 4 ++-- Application/Mobile/Controller/CommonController.class.php | 2 +- Application/Mobile/Controller/SsgController.class.php | 2 +- Application/Mobile/Controller/UserController.class.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Controller/PublicController.class.php b/Application/Admin/Controller/PublicController.class.php index 453d2fbbc..0b76890d8 100644 --- a/Application/Admin/Controller/PublicController.class.php +++ b/Application/Admin/Controller/PublicController.class.php @@ -345,7 +345,7 @@ class PublicController extends \Think\Controller public function telsafecode($phone = '', $delay = 10, $flag = true) { $taskClient = new TaskClient(); - $result = $taskClient->sendSms($phone); + $result = $taskClient->sendSms($phone, get_client_ip()); $data = []; if ($result['code'] == TaskClient::SUCCESS) { $data['status'] = 1; diff --git a/Application/Base/Tool/TaskClient.class.php b/Application/Base/Tool/TaskClient.class.php index 711593418..0b8371c94 100644 --- a/Application/Base/Tool/TaskClient.class.php +++ b/Application/Base/Tool/TaskClient.class.php @@ -28,9 +28,9 @@ class TaskClient return json_decode($result, true); } - public function sendSms($mobile, $type = 'common') + public function sendSms($mobile, $clientIp, $type = 'common') { - return $this->post('/message/sms-send', ['mobile' => $mobile, 'type' => $type]); + return $this->post('/message/sms-send', ['mobile' => $mobile, 'type' => $type, 'client_ip' => $clientIp]); } public function checkSms($mobile, $code) diff --git a/Application/Mobile/Controller/CommonController.class.php b/Application/Mobile/Controller/CommonController.class.php index 2422f594c..34778e276 100644 --- a/Application/Mobile/Controller/CommonController.class.php +++ b/Application/Mobile/Controller/CommonController.class.php @@ -220,7 +220,7 @@ class CommonController extends BaseController { { $phone = I('phone'); $taskClient = new TaskClient(); - $result = $taskClient->sendSms($phone); + $result = $taskClient->sendSms($phone, get_client_ip()); $data = []; if ($result['code'] == TaskClient::SUCCESS) { $this->respondSuccess('发送成功'); diff --git a/Application/Mobile/Controller/SsgController.class.php b/Application/Mobile/Controller/SsgController.class.php index b870df024..7ff8cae37 100644 --- a/Application/Mobile/Controller/SsgController.class.php +++ b/Application/Mobile/Controller/SsgController.class.php @@ -409,7 +409,7 @@ class SsgController extends BaseController { { $phone = I('phone'); $taskClient = new TaskClient(); - $result = $taskClient->sendSms($phone); + $result = $taskClient->sendSms($phone, get_client_ip()); $data = []; if ($result['code'] == TaskClient::SUCCESS) { $data['status'] = 1; diff --git a/Application/Mobile/Controller/UserController.class.php b/Application/Mobile/Controller/UserController.class.php index bb06322fa..fffb9cd55 100644 --- a/Application/Mobile/Controller/UserController.class.php +++ b/Application/Mobile/Controller/UserController.class.php @@ -581,7 +581,7 @@ class UserController extends BaseController public function telsafecode($phone = '', $delay = 10, $flag = true) { $taskClient = new TaskClient(); - $result = $taskClient->sendSms($phone); + $result = $taskClient->sendSms($phone, get_client_ip()); $data = []; if ($result['code'] == TaskClient::SUCCESS) { $data['status'] = 1;