diff --git a/.env.example b/.env.example index f2693f9..81a046c 100644 --- a/.env.example +++ b/.env.example @@ -18,6 +18,12 @@ DB_USERNAME= # 数据库密码[string] DB_PASSWORD= +# Redis +# Redis地址[string] +RD_HOST= +# Redis端口[int] +RD_PORT= + # 验证码配置 # 验证服务提供商[reCAPTCHA,hCaptcha,Turnstile,None] VERIFY_PROVIDER= diff --git a/config/web.php b/config/web.php index 8fa242a..d268cf7 100644 --- a/config/web.php +++ b/config/web.php @@ -61,8 +61,8 @@ $config = [ ], 'redis' => [ 'class' => 'yii\redis\Connection', - 'hostname' => 'localhost', - 'port' => 6379, + 'hostname' => $_ENV['RD_HOST'], + 'port' => $_ENV['RD_PORT'], 'database' => 0, ], 'db' => $db,