From 02ff41c0f21e71fdfd0edd5f4d0fb2dc73d2540f Mon Sep 17 00:00:00 2001 From: Karson Date: Mon, 22 Jan 2018 23:25:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0=E5=B8=B8?= =?UTF-8?q?=E8=A7=84=E7=AE=A1=E7=90=86=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=97=B6=E8=BF=9C=E7=A8=8B=E9=AA=8C=E8=AF=81=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20=E4=BF=AE=E5=A4=8DSMS=E5=8F=91=E9=80=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/general/Config.php | 6 +++--- application/api/controller/Sms.php | 10 +++++----- application/common/library/Sms.php | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/admin/controller/general/Config.php b/application/admin/controller/general/Config.php index 80c154c8..b594fda1 100644 --- a/application/admin/controller/general/Config.php +++ b/application/admin/controller/general/Config.php @@ -191,16 +191,16 @@ class Config extends Backend $config = $this->model->get($params); if (!$config) { - return json(['ok' => '']); + return $this->success(); } else { - return json(['error' => __('Name already exist')]); + return $this->error(__('Name already exist')); } } else { - return json(['error' => __('Invalid parameters')]); + return $this->error(__('Invalid parameters')); } } diff --git a/application/api/controller/Sms.php b/application/api/controller/Sms.php index 99c7deb4..5e558c42 100644 --- a/application/api/controller/Sms.php +++ b/application/api/controller/Sms.php @@ -23,8 +23,8 @@ class Sms extends Api /** * 发送验证码 * - * @param string $mobile 手机号 - * @param string $event 事件名称 + * @param string $mobile 手机号 + * @param string $event 事件名称 */ public function send() { @@ -70,9 +70,9 @@ class Sms extends Api /** * 检测验证码 * - * @param string $mobile 手机号 - * @param string $event 事件名称 - * @param string $captcha 验证码 + * @param string $mobile 手机号 + * @param string $event 事件名称 + * @param string $captcha 验证码 */ public function check() { diff --git a/application/common/library/Sms.php b/application/common/library/Sms.php index aa1e2c9f..59d5f17d 100644 --- a/application/common/library/Sms.php +++ b/application/common/library/Sms.php @@ -35,8 +35,8 @@ class Sms where(['mobile' => $mobile, 'event' => $event]) ->order('id', 'DESC') ->find(); - $result = Hook::listen('sms_get', $sms); - return $result ? $result : NULL; + Hook::listen('sms_get', $sms, null, true); + return $sms ? $sms : NULL; } /** @@ -52,7 +52,7 @@ class Sms $code = is_null($code) ? mt_rand(1000, 9999) : $code; $time = time(); $sms = \app\common\model\Sms::create(['event' => $event, 'mobile' => $mobile, 'code' => $code, 'createtime' => $time]); - $result = Hook::listen('sms_send', $sms); + $result = Hook::listen('sms_send', $sms, null, true); if (!$result) { $sms->delete(); @@ -69,7 +69,7 @@ class Sms */ public static function notice($params = []) { - $result = Hook::listen('sms_notice', $params); + $result = Hook::listen('sms_notice', $params, null, true); return $result ? TRUE : FALSE; } @@ -100,7 +100,7 @@ class Sms } else { - $result = Hook::listen('sms_check', $sms); + $result = Hook::listen('sms_check', $sms, null, true); return $result; } }