首先查看代码是否引入了AutoController
其次 , 控制器继承AbstractController , 文档中没有继承
<?php
namespace App\Controller;
use Hyperf\HttpServer\Annotation\AutoController;
/**
* @AutoController()
*/
class UserController extends AbstractController
{
public function index()
{
return [1,2,3,4];
}
}
最后在shell中输入 php bin/hyperf.php describe:routes 查看路由列表