From 298a59adc8fe040c8b4a8dcaa859311f5627fdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E9=87=91=E5=8B=87?= Date: Tue, 14 Oct 2025 14:54:04 +0800 Subject: [PATCH] * [apv2] Fix webRoot. --- framework/base/helper.class.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php index ddce07a11c..9514123932 100644 --- a/framework/base/helper.class.php +++ b/framework/base/helper.class.php @@ -107,9 +107,22 @@ class baseHelper } /* 生成url链接的开始部分。Set the begin parts of the link. */ - if($config->requestType == 'PATH_INFO') $link = $config->webRoot . $appName; - if($config->requestType != 'PATH_INFO') $link = $config->webRoot . $appName . basename((string) $_SERVER['SCRIPT_NAME']); - if($config->requestType == 'PATH_INFO2') $link = '/'; + if($app->apiVersion == 'v2') + { + $link = $config->webRoot . '/api.php/v2/'; + } + else if($config->requestType == 'PATH_INFO2') + { + $link = '/'; + } + else if($config->requestType == 'PATH_INFO') + { + $link = $config->webRoot . $appName; + } + else + { + $link = $config->webRoot . $appName . basename((string) $_SERVER['SCRIPT_NAME']); + } /** * #1: RequestType为GET。When the requestType is GET.