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;