From 5cdc25a5a9dcf643a3339757ffb3350b16480837 Mon Sep 17 00:00:00 2001 From: fengyuexingzi Date: Sat, 28 Oct 2017 10:33:28 +0800 Subject: [PATCH] =?UTF-8?q?define=20RELATIVE=5FPATH=20=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config.php | 2 +- public/index.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/config.php b/application/config.php index d59ed30..e415f4c 100644 --- a/application/config.php +++ b/application/config.php @@ -145,7 +145,7 @@ return [ 'view_replace_str' => [ '__PUBLIC__' => 'public', '__ROOT__' => '/', - '__RELATIVE_PATH__' => $_SERVER["SCRIPT_NAME"] . '/..', + '__RELATIVE_PATH__' => RELATIVE_PATH, ], // 默认跳转页面对应的模板文件 diff --git a/public/index.php b/public/index.php index b0bb92e..15b2527 100644 --- a/public/index.php +++ b/public/index.php @@ -14,6 +14,9 @@ // 定义应用目录 define('APP_PATH', __DIR__ . '/../application/'); +//资源相对路径 +define('RELATIVE_PATH', dirname($_SERVER["SCRIPT_NAME"])); + // 加载框架引导文件 require __DIR__ . '/../thinkphp/start.php';