From be72e734239bf285af282553ccdaa37d4b6d6009 Mon Sep 17 00:00:00 2001 From: leon <916117771@qq.com> Date: Fri, 10 Apr 2026 10:27:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(ota):=20=E4=BF=AE=E5=A4=8DAPK=E4=B8=8B?= =?UTF-8?q?=E8=BD=BDURL=E6=9E=84=E5=BB=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新注释说明relativePath参数已包含/uploads/前缀 - 移除硬编码的/uploads/路径拼接 - 添加注释解释FastAdmin存储路径结构 - 优化URL构建避免重复路径分隔符 --- application/api/controller/Ota.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/api/controller/Ota.php b/application/api/controller/Ota.php index 96e81ef..af5bf85 100644 --- a/application/api/controller/Ota.php +++ b/application/api/controller/Ota.php @@ -112,7 +112,7 @@ class Ota extends Api * * 客户端要求必须使用 HTTPS 协议,此处强制转换为 HTTPS。 * - * @param string $relativePath 相对路径 + * @param string $relativePath 相对路径(FastAdmin 已含 /uploads/ 前缀) * @return string 完整 HTTPS URL */ private function buildApkUrl($relativePath) @@ -120,7 +120,8 @@ class Ota extends Api $domain = request()->domain(); // 强制使用 HTTPS,客户端要求 downloadUrl 必须以 https:// 开头 $domain = preg_replace('/^http:\/\//i', 'https://', $domain); - return rtrim($domain, '/') . '/uploads/' . ltrim($relativePath, '/'); + // FastAdmin 存储的路径已含 /uploads/ 前缀,直接拼接即可 + return rtrim($domain, '/') . '/' . ltrim($relativePath, '/'); } /**