You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* php artisan serve 路由器(优先于 vendor 内置 server.php)。
|
|
|
|
|
|
*
|
|
|
|
|
|
* 生产构建产物在 public/admin/。若用 file_exists(),目录也会命中并 return false,
|
|
|
|
|
|
* PHP 内置服务器会把 admin/index.html 当目录首页,从而把
|
|
|
|
|
|
* /admin/c/hsxt/login 的 PATH_INFO 改写成 /c/hsxt/login,导致路由 404、页面空白。
|
|
|
|
|
|
* 这里仅对真实文件放行静态资源,其余一律交给 Laravel。
|
|
|
|
|
|
*/
|
|
|
|
|
|
$publicPath = getcwd();
|
|
|
|
|
|
|
|
|
|
|
|
$uri = urldecode(
|
|
|
|
|
|
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ?? ''
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
if ($uri !== '/' && is_file($publicPath.$uri)) {
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
require_once $publicPath.'/index.php';
|