From 29b20cbedd3af1db45b3099c024dbcd42658aa9f Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Wed, 7 Jun 2023 13:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=E4=B8=8D?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E9=AA=8C=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/Auth.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index 639e4e1c..bc222501 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -453,7 +453,7 @@ class Auth extends BaseController $data = $this->request->params(['phone', 'sms_code', 'spread', 'auth_token', ['user_type', 'h5']]); $validate->sceneSmslogin()->check($data); $sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login'); - if (!$sms_code) return app('json')->fail('验证码不正确'); + if (!$sms_code && !env('APP_DEBUG')) return app('json')->fail('验证码不正确'); $user = $repository->accountByUser($data['phone']); $auth = $this->parseAuthToken($data['auth_token']); if (!$user) $user = $repository->registr($data['phone'], null, $data['user_type']); @@ -509,8 +509,9 @@ class Auth extends BaseController $data = $this->request->params(['phone', 'sms_code', 'spread', 'pwd', 'auth_token', ['user_type', 'h5']]); $validate->check($data); $sms_code = app()->make(SmsService::class)->checkSmsCode($data['phone'], $data['sms_code'], 'login'); - if (!$sms_code) + if (!$sms_code && !env('APP_DEBUG')) { return app('json')->fail('验证码不正确'); + } $user = $repository->accountByUser($data['phone']); if ($user) return app('json')->fail('用户已存在'); $auth = $this->parseAuthToken($data['auth_token']);