安装引导程序

This commit is contained in:
TL 2022-08-15 16:40:08 +08:00
parent 69ef6e9355
commit 5a06a7511e
4 changed files with 10 additions and 6 deletions

View File

@ -26,10 +26,10 @@ class AdminServiceProvider extends ServiceProvider
*/
public function boot()
{
$uri = request()->getRequestUri();
if (Str::startsWith($uri, "/installer")) {
if(!installed()) {
return;
}
$uri = request()->getRequestUri();
load_settings();
$this->loadRoutesFrom(__DIR__ . '/../Routes/admin.php');

View File

@ -564,3 +564,8 @@ function add_action($hook, $callback, int $priority = 20, int $arguments = 1)
{
Eventy::addAction($hook, $callback, $priority, $arguments);
}
function installed()
{
return file_exists(storage_path('installed'));
}

View File

@ -39,8 +39,7 @@ class PluginServiceProvider extends ServiceProvider
*/
public function boot()
{
$uri = request()->getRequestUri();
if (Str::startsWith($uri, "/installer")) {
if(!installed()) {
return;
}
$manager = app('plugin');

View File

@ -34,10 +34,10 @@ class ShopServiceProvider extends ServiceProvider
*/
public function boot()
{
$uri = request()->getRequestUri();
if (Str::startsWith($uri, "/installer")) {
if(!installed()) {
return;
}
$uri = request()->getRequestUri();
$this->loadRoutesFrom(__DIR__ . '/../Routes/shop.php');
load_settings();