Closed aimiteam closed 3 years ago
php version: PHP 8.0.3 (cli) (built: Mar 5 2021 07:53:56) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.3, Copyright (c) Zend Technologies with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies config/route.php:
PHP 8.0.3 (cli) (built: Mar 5 2021 07:53:56) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.3, Copyright (c) Zend Technologies with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies
use Webman\Route; use app\constants\Code; Route::disableDefaultRoute(); // 处理 404 Route::fallback(function () { return responseJson(Code::NOTFOUND_ERR, '404 not found'); }); Route::group('/api', function () { Route::get('/home', [app\controller\api\HomeController::class, 'index']); }); Route::group('/admin', function () { Route::get('/info', [app\controller\admin\AuthController::class, 'info']); Route::post('/logout', [app\controller\admin\AuthController::class, 'logout']); })->middleware([app\middleware\AdminAuthCheck::class]); Route::get('/admin/home', [app\controller\admin\HomeController::class, 'index']); Route::post('/admin/login', [app\controller\admin\AuthController::class, 'login']);
but php7.4 or 7.3 is OK.
更新下 workerman/webman-framework composer require workerman/webman-framework ^1.0.15
composer require workerman/webman-framework ^1.0.15
php version:
PHP 8.0.3 (cli) (built: Mar 5 2021 07:53:56) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.3, Copyright (c) Zend Technologies with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies
config/route.php:but php7.4 or 7.3 is OK.