$phoneNumber ]; try { validate(User::class)->scene('send_code')->check($data); } catch (ValidateException $e) { return show(config('status.error'), $e->getError()); } // 调用business层 if (SmsBus::sendCode($phoneNumber, 6, 'jd')) { return show(config('status.success'), '发送验证码成功'); } return show(config('status.success'), '发送验证码失败'); } }