From 4290688db0b761e9390ecc5a77c0a241a0500991 Mon Sep 17 00:00:00 2001 From: vilson <545522390@qq.com> Date: Wed, 13 Feb 2019 22:08:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: vilson <545522390@qq.com> --- application/project/controller/Login.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/application/project/controller/Login.php b/application/project/controller/Login.php index a891ba1..a5cd59d 100644 --- a/application/project/controller/Login.php +++ b/application/project/controller/Login.php @@ -118,15 +118,17 @@ class Login extends BasicApi { $mobile = $this->request->post('mobile', ''); $code = RandomService::numeric(6); - $sms = new Sms(); - $result = $sms->vSend($mobile, [ - 'data' => [ - 'project' => 'DWYsW1', - 'code' => $code - ], - ]); - if (isError($result)) { - $this->error('系统繁忙'); + if (config('sms.debug')) { + $sms = new Sms(); + $result = $sms->vSend($mobile, [ + 'data' => [ + 'project' => 'DWYsW1', + 'code' => $code + ], + ]); + if (isError($result)) { + $this->error('系统繁忙'); + } } session('captcha', $code); $this->success('', config('sms.debug') ? $code : '');