From 4c5820e43123605aa95c21467d65a5c501143b92 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 6 Jun 2023 12:41:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/thinkorm.php | 12 ++++++------ plugin/admin/config/database.php | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/thinkorm.php b/config/thinkorm.php index 0d54538..2942858 100644 --- a/config/thinkorm.php +++ b/config/thinkorm.php @@ -7,15 +7,15 @@ return [ // 数据库类型 'type' => 'mysql', // 服务器地址 - 'hostname' => '127.0.0.1', + 'hostname' => getenv('DB_HOST'), // 数据库名 - 'database' => 'webman_admin', + 'database' => getenv('DB_NAME'), // 数据库用户名 - 'username' => 'root', + 'username' =>getenv('DB_USER'), // 数据库密码 - 'password' => '123456', + 'password' => getenv('DB_PASSWORD'), // 数据库连接端口 - 'hostport' => '3306', + 'hostport' => getenv('DB_PORT'), // 数据库连接参数 'params' => [ // 连接超时3秒 @@ -24,7 +24,7 @@ return [ // 数据库编码默认采用utf8 'charset' => 'utf8', // 数据库表前缀 - 'prefix' => 'wa_', + 'prefix' => getenv('DB_PREFIX'), // 断线重连 'break_reconnect' => true, // 关闭SQL监听日志 diff --git a/plugin/admin/config/database.php b/plugin/admin/config/database.php index f83b764..1b1d50b 100644 --- a/plugin/admin/config/database.php +++ b/plugin/admin/config/database.php @@ -4,14 +4,14 @@ return [ 'connections' => [ 'mysql' => [ 'driver' => 'mysql', - 'host' => '127.0.0.1', - 'port' => '3306', - 'database' => 'webman_admin', - 'username' => 'root', - 'password' => '123456', + 'host' => getenv('DB_HOST'), + 'port' => getenv('DB_PORT'), + 'database' => getenv('DB_NAME'), + 'username' => getenv('DB_USER'), + 'password' => getenv('DB_PASSWORD'), 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_general_ci', - 'prefix' => '', + 'prefix' => getenv('DB_PREFIX'), 'strict' => true, 'engine' => null, ],