diff --git a/plugin/think-plugs-static/stc/.env.example b/plugin/think-plugs-static/stc/.env.example index 7cbba0cc4..7fe25d054 100644 --- a/plugin/think-plugs-static/stc/.env.example +++ b/plugin/think-plugs-static/stc/.env.example @@ -1,16 +1,21 @@ [db] +# 数据库类型 type=sqlite -[mysql] -hostname=127.0.0.1 -hostport=3306 -database=thinkadmin -username=root -password= -prefix= +# MySQL 数据库配置 +mysql_hostname=127.0.0.1 +mysql_hostport=3306 +mysql_database=thinkadmin +mysql_username=root +mysql_password= +mysql_prefix= -[redis] -host=127.0.0.1 -port=6379 -password= -select=0 +[cache] +# 缓存类型 +type=file + +# Redis 缓存服务配置 +redis_hostname=127.0.0.1 +redis_hostport=6379 +redis_password= +redis_select=0 \ No newline at end of file diff --git a/plugin/think-plugs-static/stc/config/cache.php b/plugin/think-plugs-static/stc/config/cache.php index 1e6d0f853..6fe9560ad 100644 --- a/plugin/think-plugs-static/stc/config/cache.php +++ b/plugin/think-plugs-static/stc/config/cache.php @@ -16,7 +16,7 @@ return [ // 默认缓存驱动 - 'default' => 'file', + 'default' => env('cache.type', 'file'), // 缓存连接配置 'stores' => [ 'file' => [ @@ -50,10 +50,10 @@ return [ 'redis' => [ // 驱动方式 'type' => 'redis', - 'host' => env('redis.host', '127.0.0.1'), - 'port' => env('redis.port', 6379), - 'select' => env('redis.select', 0), - 'password' => env('redis.password', ''), + 'host' => env('cache.redis_hostname', '127.0.0.1'), + 'port' => env('cache.redis_hostport', 6379), + 'password' => env('cache.redis_password', ''), + 'select' => env('cache.redis_select', 0), ] ], ]; \ No newline at end of file diff --git a/plugin/think-plugs-static/stc/config/database.php b/plugin/think-plugs-static/stc/config/database.php index 296cd6553..4ee1437cf 100644 --- a/plugin/think-plugs-static/stc/config/database.php +++ b/plugin/think-plugs-static/stc/config/database.php @@ -16,7 +16,7 @@ return [ // 默认使用的数据库连接配置 - 'default' => env('db.type', 'sqlite'), + 'default' => env('type.db_type', 'sqlite'), // 自定义时间查询规则 'time_query_rule' => [], // 自动写入时间戳字段 @@ -29,15 +29,15 @@ return [ // 数据库类型 'type' => 'mysql', // 服务器地址 - 'hostname' => env('mysql.hostname', '127.0.0.1'), + 'hostname' => env('db.mysql_hostname', '127.0.0.1'), // 数据库名 - 'database' => env('mysql.database', 'thinkadmin'), + 'database' => env('db.mysql_database', 'thinkadmin'), // 用户名 - 'username' => env('mysql.username', 'root'), + 'username' => env('db.mysql_username', 'root'), // 密码 - 'password' => env('mysql.password', ''), + 'password' => env('db.mysql_password', ''), // 端口 - 'hostport' => env('mysql.hostport', '3306'), + 'hostport' => env('db.mysql_hostport', '3306'), // 数据库连接参数 'params' => [], // 数据库编码默认采用 utf8