Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to a member function input() on null #21

Open
xiucaiwu opened this issue Jul 1, 2021 · 0 comments
Open

Call to a member function input() on null #21

xiucaiwu opened this issue Jul 1, 2021 · 0 comments

Comments

@xiucaiwu
Copy link

xiucaiwu commented Jul 1, 2021

版本:2.1
情况描述:控制器中通过$this->request->input来获取参数,启动监听后获取不了参数,如果用原生的启动是没有问题的
错误情况:
[DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\Config\Listener\RegisterPropertyHandlerListener listener. [DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\ExceptionHandler\Listener\ErrorExceptionHandler listener. [DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\ExceptionHandler\Listener\ExceptionHandlerListener listener. [DEBUG] Event Hyperf\Framework\Event\BootApplication handled by Hyperf\DbConnection\Listener\RegisterConnectionResolverListener listener. [DEBUG] Event Hyperf\Framework\Event\BeforeMainServerStart handled by Hyperf\Process\Listener\BootProcessListener listener. [DEBUG] Event Hyperf\Framework\Event\OnStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener. [INFO] Worker#0 started. [INFO] HTTP Server listening at 0.0.0.0:9501 [DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener. [DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener. [DEBUG] Event Hyperf\Framework\Event\OnManagerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener. [INFO] Worker#1 started. [DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\AfterWorkerStartListener listener. [DEBUG] Event Hyperf\Framework\Event\AfterWorkerStart handled by Hyperf\Server\Listener\InitProcessTitleListener listener. [ERROR] Call to a member function input() on null[34] in /data/wwwroot/hyperf-skeleton/app/Controller/IndexController.php [ERROR] #0 /data/wwwroot/hyperf-skeleton/vendor/hyperf/http-server/src/CoreMiddleware.php(161): App\Controller\IndexController->verifyCode()

控制器代码片段
public function verifyCode() { $uuid = $this->request->input('uuid', ''); if(empty($uuid)) { return ['code' => 500, 'msg' => 'uuid is empty', 'data' => []]; } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant