From 4455a2224bd1ebdab008c36ba4cd480dc32fcde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 19 Oct 2022 12:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/app.php | 8 ++++---- config/cookie.php | 4 ++-- config/database.php | 4 ++-- config/filesystem.php | 6 +++--- config/view.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/config/app.php b/config/app.php index 1f52662b0..f8e6bed5b 100644 --- a/config/app.php +++ b/config/app.php @@ -39,13 +39,13 @@ return [ 'cors_methods' => 'GET,PUT,POST,PATCH,DELETE', // CORS 跨域头部字段 'cors_headers' => 'Api-Type,Api-Name,Api-Uuid,Api-Token,User-Form-Token,User-Token,Token', - // 显示错误的消息,仅产品模式有效 + // 显示错误消息内容,仅产品模式有效 'error_message' => '页面错误!请稍后再试~', // 异常模板路径配置,仅开发模式有效 - 'exception_tmpl' => app()->getRootPath() . 'app/admin/view/error.php', + 'exception_tmpl' => with_path('app/admin/view/error.php'), // 异常状态模板配置,仅生产模式有效 'http_exception_template' => [ - 404 => app()->getRootPath() . 'public/static/theme/err/404.html', - 500 => app()->getRootPath() . 'public/static/theme/err/500.html', + 404 => with_path('public/static/theme/err/404.html'), + 500 => with_path('public/static/theme/err/500.html'), ], ]; \ No newline at end of file diff --git a/config/cookie.php b/config/cookie.php index 091cebc91..b40ea183f 100644 --- a/config/cookie.php +++ b/config/cookie.php @@ -26,7 +26,7 @@ return [ // 是否使用 setcookie 'setcookie' => true, // cookie 安全传输,只支持 https 协议 - 'secure' => app()->request->isSsl(), + 'secure' => request()->isSsl(), // samesite 安全设置,支持 'strict' 'lax' 'none' - 'samesite' => app()->request->isSsl() ? 'none' : 'lax', + 'samesite' => request()->isSsl() ? 'none' : 'lax', ]; diff --git a/config/database.php b/config/database.php index e28767aea..91fa84081 100644 --- a/config/database.php +++ b/config/database.php @@ -59,14 +59,14 @@ return [ // 监听SQL执行日志 'trigger_sql' => true, // 开启字段类型缓存 - 'fields_cache' => !app()->isDebug(), + 'fields_cache' => is_online(), ], 'sqlite' => [ 'charset' => 'utf8', // 数据库类型 'type' => 'sqlite', // 数据库文件 - 'database' => app()->getRootPath() . 'database/sqlite.db', + 'database' => with_path('database/sqlite.db'), // 监听执行日志 'trigger_sql' => true, // 其他参数字段 diff --git a/config/filesystem.php b/config/filesystem.php index 4cdcecd24..1045114e5 100644 --- a/config/filesystem.php +++ b/config/filesystem.php @@ -21,14 +21,14 @@ return [ 'disks' => [ 'local' => [ 'type' => 'local', - 'root' => app()->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'storage', + 'root' => with_path('runtime/storage'), ], 'public' => [ // 磁盘类型 'type' => 'local', // 磁盘路径 - 'root' => app()->getRootPath() . 'public' . DIRECTORY_SEPARATOR . 'storage', - // 磁盘路径对应的外部URL路径 + 'root' => with_path('public/storage'), + // 外部路径 'url' => '/storage', // 可见性 'visibility' => 'public', diff --git a/config/view.php b/config/view.php index 0dcbabd39..b089b3b8c 100644 --- a/config/view.php +++ b/config/view.php @@ -26,7 +26,7 @@ return [ // 模板文件名分隔符 'view_depr' => DIRECTORY_SEPARATOR, // 模板缓存配置 - 'tpl_cache' => !app()->isDebug(), + 'tpl_cache' => is_online(), // 模板引擎标签开始标记 'tpl_begin' => '{', // 模板引擎标签结束标记