From 73f5e7fa147b4b72afa76bc0a5ce7256817f4a73 Mon Sep 17 00:00:00 2001 From: leon <916117771@qq.com> Date: Fri, 10 Apr 2026 09:07:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ota):=20=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=B7=AF=E5=BE=84=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 root_path() 函数调用替换为 ROOT_PATH 常量 - 提高代码可读性和性能 - 统一路径常量使用方式 --- application/api/controller/Ota.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/controller/Ota.php b/application/api/controller/Ota.php index 9f09005..96e81ef 100644 --- a/application/api/controller/Ota.php +++ b/application/api/controller/Ota.php @@ -131,7 +131,7 @@ class Ota extends Api */ private function calculateFileInfo($relativePath) { - $fullPath = root_path() . 'public' . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . ltrim($relativePath, '/'); + $fullPath = ROOT_PATH . 'public' . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . ltrim($relativePath, '/'); if (!file_exists($fullPath)) { return null; }