From b306b433d8ccbe2fce654166804b4e8083aa7ffb Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 16 Jun 2025 10:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=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/Http/Controllers/Mobile/UserController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Mobile/UserController.php b/app/Http/Controllers/Mobile/UserController.php index 81d9d2f..584c057 100755 --- a/app/Http/Controllers/Mobile/UserController.php +++ b/app/Http/Controllers/Mobile/UserController.php @@ -312,12 +312,12 @@ class UserController extends CommonController $messages = [ 'mobile.required' => '手机号必填', 'mobile.numeric' => '手机号格式错误', - // 'code' => '验证码必填', + 'code' => '验证码必填', 'is_bind' => '是否绑定必填', ]; $validator = Validator::make($all, [ 'mobile' => 'required|numeric', - // 'code' => 'required', + 'code' => 'required', 'is_bind' => 'required', ], $messages); if ($validator->fails()) { @@ -361,19 +361,19 @@ class UserController extends CommonController $messages = [ 'mobile.required' => '手机号必填', 'mobile.numeric' => '手机号格式错误', - // 'code' => '验证码必填', + 'code' => '验证码必填', ]; $validator = Validator::make($all, [ 'mobile' => 'required|numeric', - // 'code' => 'required', + 'code' => 'required', ], $messages); if ($validator->fails()) { return $this->fail([StarterResponseCode::START_ERROR_PARAMETER, implode(',', $validator->errors()->all())]); } $key = 'sms_' . $all['mobile']; $check = Cache::get($key); - // if (empty($check)) return $this->fail([ResponseCode::ERROR_BUSINESS, '请先发送验证码']); - // if ($check['code'] != $all['code']) return $this->fail([ResponseCode::ERROR_BUSINESS, '验证码错误']); + if (empty($check)) return $this->fail([ResponseCode::ERROR_BUSINESS, '请先发送验证码']); + if ($check['code'] != $all['code']) return $this->fail([ResponseCode::ERROR_BUSINESS, '验证码错误']); // 判断手机号是否存在 $hasMobile = User::where('mobile', $all['mobile'])->first(); if ($hasMobile) {