From 355615660e4976191e4ddca8d1ffcfb78a4fead5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Tue, 15 Oct 2024 13:05:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=95=B0=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-plugs-static/composer.json | 1 + plugin/think-plugs-static/stc/config/database.php | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugin/think-plugs-static/composer.json b/plugin/think-plugs-static/composer.json index 54238089a..4763bda45 100644 --- a/plugin/think-plugs-static/composer.json +++ b/plugin/think-plugs-static/composer.json @@ -17,6 +17,7 @@ "plugin": { "copy": { "stc/think": "!think", + "stc/.env.example": ".env.example", "stc/public/index.php": "!public/index.php", "stc/public/static/plugs": "!public/static/plugs", "stc/public/static/theme": "!public/static/theme", diff --git a/plugin/think-plugs-static/stc/config/database.php b/plugin/think-plugs-static/stc/config/database.php index 039e83da9..58311dd87 100644 --- a/plugin/think-plugs-static/stc/config/database.php +++ b/plugin/think-plugs-static/stc/config/database.php @@ -40,10 +40,10 @@ return [ 'hostport' => env('db.mysql_hostport', '3306'), // 数据库连接参数 'params' => [], - // 数据库编码默认采用 utf8 - 'charset' => env('mysql.charset', 'utf8mb4'), // 数据库表前缀 - 'prefix' => env('mysql.prefix', ''), + 'prefix' => env('db.mysql_prefix', ''), + // 数据库编码默认采用 utf8mb4 + 'charset' => env('db.mysql_charset', 'utf8mb4'), // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 'deploy' => 0, // 数据库读写是否分离 主从式有效 @@ -62,11 +62,12 @@ return [ 'fields_cache' => isOnline(), ], 'sqlite' => [ - 'charset' => 'utf8', // 数据库类型 'type' => 'sqlite', // 数据库文件 'database' => syspath('database/sqlite.db'), + // 数据库编码默认采用 utf8 + 'charset' => 'utf8', // 监听执行日志 'trigger_sql' => true, // 其他参数字段