fix: 修复本地初始化与静态资源加载

This commit is contained in:
WuYongJie 2026-07-21 14:03:27 +08:00
parent 3c95780bf1
commit 467cc87b8d
4 changed files with 26 additions and 5 deletions

View File

@ -4,6 +4,8 @@ namespace App\Utilities;
use App\Jobs\Auth\CreateUser;
use App\Jobs\Common\CreateCompany;
use App\Models\Auth\Permission;
use App\Models\Auth\Role;
use App\Utilities\Console;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Config;
@ -244,17 +246,31 @@ class Installer
'locale' => $locale,
'enabled' => '1',
]));
// This application uses one local ledger, so no setup wizard is needed.
setting()->set('wizard.completed', '1');
setting()->save();
}
public static function createUser($email, $password, $locale)
{
$role = Role::where('name', SystemAccess::SUPER_ADMIN)->firstOrFail();
$permission = Permission::firstOrCreate(
['name' => 'read-admin-panel'],
['display_name' => 'Read Admin Panel']
);
if (! $role->hasPermission($permission->name)) {
$role->attachPermission($permission);
}
dispatch_sync(new CreateUser([
'name' => '',
'email' => $email,
'password' => $password,
'locale' => $locale,
'companies' => ['1'],
'roles' => ['1'],
'roles' => [$role->id],
'enabled' => '1',
]));
}

View File

@ -2,6 +2,10 @@
use Illuminate\Support\Str;
$mysqlSslCaOption = class_exists(\Pdo\Mysql::class)
? \Pdo\Mysql::ATTR_SSL_CA
: \PDO::MYSQL_ATTR_SSL_CA;
return [
/*
@ -77,7 +81,7 @@ return [
'NO_ENGINE_SUBSTITUTION',
],
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
$mysqlSslCaOption => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
@ -115,7 +119,7 @@ return [
'NO_ENGINE_SUBSTITUTION',
],
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
$mysqlSslCaOption => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],

View File

@ -26,7 +26,7 @@ class Permissions extends Seeder
private function create()
{
$rows = [
'admin' => [
'super_admin' => [
'admin-panel' => 'r',
'api' => 'r',
'auth-profile' => 'r,u',
@ -80,7 +80,7 @@ class Permissions extends Seeder
'widgets-profit-loss' => 'r',
'widgets-receivables' => 'r',
],
'manager' => [
'admin' => [
'admin-panel' => 'r',
'auth-profile' => 'r,u',
'banking-accounts' => 'c,r,u,d',

1
public/public Symbolic link
View File

@ -0,0 +1 @@
.