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) {