From 57100e07ba28ea4785831101de544812e0b6508c Mon Sep 17 00:00:00 2001 From: Jackson Dou Date: Tue, 10 Sep 2024 12:30:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=88=B0=E8=99=9A=E6=8B=9F=E4=B8=BB=E6=9C=BA?= =?UTF-8?q?=E7=9A=84=E5=AD=90=E8=B7=AF=E5=BE=84=EF=BC=8C=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=A7=BB=E9=99=A4URL=E4=B8=AD=E7=9A=84=E5=AD=90=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/index.php | 17 +++++++++++------ src/config.php | 5 +++++ src/includes/common.php | 12 +++++++++--- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/admin/index.php b/src/admin/index.php index 5123b9d..415a3c6 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -125,7 +125,7 @@ - + @@ -151,9 +151,17 @@ - + + + + + + + + +
系统程序程序名称 app->name; ?> 程序版本 v
程序最大运行时间 s网站路径程序安装路径 /
程序安装在主站子目录子目录位置
@@ -176,10 +184,7 @@ 联系QQ350430869 - Copyright - - Copyright © CROGRAM. All Rights Reserved. - + Copyright © app->name; ?>. All Rights Reserved. diff --git a/src/config.php b/src/config.php index 1e2617b..c46b54e 100644 --- a/src/config.php +++ b/src/config.php @@ -1,4 +1,9 @@ '' +); + /* 数据库配置 */ $dbconfig = array( 'host' => '127.0.0.1', // 数据库服务器 diff --git a/src/includes/common.php b/src/includes/common.php index 819c3dd..e8f728f 100644 --- a/src/includes/common.php +++ b/src/includes/common.php @@ -6,7 +6,7 @@ error_reporting(0); define('IN_CRONLITE', true); define('VERSION', '1002'); -define('APP_VERSION', '1.0.3'); +define('APP_VERSION', '1.0.4'); define('SYSTEM_ROOT', dirname(__FILE__)); define('ROOT', dirname(SYSTEM_ROOT)); // define('CC_Defender', 1); @@ -21,9 +21,8 @@ include_once(SYSTEM_ROOT . '/functions.php'); $scriptpath = str_replace('\\', '/', $_SERVER['SCRIPT_NAME']); -$site_path = substr($scriptpath, 0, strrpos($scriptpath, '/')); $site_http = (is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']; -$site_url = $site_http . $site_path; +$site_path = substr($scriptpath, 0, strrpos($scriptpath, '/')); if (file_exists(ROOT . '/install/index.php') && !file_exists(ROOT . '/install/install.lock')) { // 有安装脚本却没有锁定文件 @@ -38,6 +37,13 @@ // 配置文件 require ROOT . '/config.php'; +if (isset($app_config['subpath']) && !empty($app_config['subpath'])) { + // 程序安装在子路径,移除URL中的子路径 + $site_path = str_replace($app_config['subpath'], '', $site_path); +} + +$site_url = $site_http . $site_path; + if (!isset($dbconfig) || !$dbconfig['user'] || !$dbconfig['pwd'] || !$dbconfig['dbname']) // 检测安装1 { sysmsg('

系统配置文件 config.php 异常!

点击此处 运行安装程序。', '站点提示信息', 1);