request->only(['account', 'type']); // 参数验证 $validate = validate('common/Auth'); if (!$validate->scene('send_code')->check($params)) { return ResponseHelper::error($validate->getError()); } try { // 调用发送验证码服务 $result = $this->authService->sendLoginCode( $params['account'], $params['type'] ); return ResponseHelper::success($result, '验证码发送成功'); } catch (\Exception $e) { return ResponseHelper::error($e->getMessage()); } } }