From 00573ff70e6e5c2fb21790f459dd1b61773865e1 Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Thu, 31 Jul 2025 09:02:25 +0800
Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E2=80=9C=E5=9C=BA?=
=?UTF-8?q?=E6=99=AF=E4=BB=8B=E7=BB=8D=E2=80=9D=E6=97=A0=E6=B3=95=E7=82=B9?=
=?UTF-8?q?=E5=87=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/index/view/pc/index/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/index/view/pc/index/index.html b/app/index/view/pc/index/index.html
index fc681983..b0bab1e6 100644
--- a/app/index/view/pc/index/index.html
+++ b/app/index/view/pc/index/index.html
@@ -117,8 +117,8 @@
{$scene.desc|raw}
{:lang_i18n('了解更多')} > -->
+
-
{/volist}
From 7cd729e4716c1f0bfb617879c9a93b29e34906fe Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Thu, 31 Jul 2025 09:03:41 +0800
Subject: [PATCH 2/7] =?UTF-8?q?fix:=20=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=A3=81=E7=9B=98=E6=9C=AA=E5=88=A4=E6=96=AD?=
=?UTF-8?q?=E2=80=9C//=E2=80=9D=E6=83=85=E5=86=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/common.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/common.php b/app/common.php
index 8ba851ef..5e356e96 100644
--- a/app/common.php
+++ b/app/common.php
@@ -155,7 +155,7 @@ if (!function_exists('get_filesystem_url')) {
*/
function get_filesystem_url(string $url, string $disk): string
{
- if (\think\helper\Str::startsWith($url, ['http://', 'https://'])) {
+ if (\think\helper\Str::startsWith($url, ['http://', 'https://', '//'])) {
return $url;
}
if (empty($disk)) {
From 85f47a075996de609d4c1c3c9f6ae919ea937a1a Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Thu, 31 Jul 2025 10:55:26 +0800
Subject: [PATCH 3/7] =?UTF-8?q?fix:=20mobile=E4=B8=8B=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=88=86=E7=B1=BB=E5=9C=B0=E5=9D=80=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/index/view/mobile/attachment/video.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/index/view/mobile/attachment/video.html b/app/index/view/mobile/attachment/video.html
index 71f4704d..39ca3a55 100644
--- a/app/index/view/mobile/attachment/video.html
+++ b/app/index/view/mobile/attachment/video.html
@@ -14,7 +14,7 @@
{notempty name="video_categorys"}
{volist name="video_categorys" id="va"}
-
{$va.name}
+
{$va.name}
{/volist}
{/notempty}
From f6dc69c8d65c3df97cb1898d238e65badd9109e0 Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Wed, 6 Aug 2025 11:40:09 +0800
Subject: [PATCH 4/7] =?UTF-8?q?fix:=20=E5=90=8E=E5=8F=B0=20=E4=BA=A7?=
=?UTF-8?q?=E5=93=81=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/controller/v1/Product.php | 21 +++++++++++++-----
app/common.php | 33 +++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/app/admin/controller/v1/Product.php b/app/admin/controller/v1/Product.php
index 83c561f0..3b635255 100644
--- a/app/admin/controller/v1/Product.php
+++ b/app/admin/controller/v1/Product.php
@@ -346,7 +346,7 @@ class Product
private function getExportProductData()
{
$server = request()->server();
- $image_host = $server['REQUEST_SCHEME'] . "://" . $server['SERVER_NAME'] . config('filesystem.disks.public.url') . '/';
+ $image_host = $server['REQUEST_SCHEME'] . "://" . $server['SERVER_NAME'] . '/';
$param = request()->param([
'name',
'spu',
@@ -360,10 +360,10 @@ class Product
'spu',
'name',
'short_name',
- 'CONCAT("' . $image_host . '", `cover_image`)' => 'cover_image',
+ 'cover_image',
'desc',
- 'CONCAT("' . $image_host . '", `video_img`)' => 'video_img',
- 'CONCAT("' . $image_host . '", `video_url`)' => 'video_url',
+ 'video_img',
+ 'video_url',
'CASE WHEN is_new = 1 THEN "是" ELSE "否" END' => 'is_new',
'CASE WHEN is_hot = 1 THEN "是" ELSE "否" END' => 'is_hot',
'CASE WHEN is_sale = 1 THEN "是" ELSE "否" END' => 'is_sale',
@@ -390,7 +390,18 @@ class Product
->order(['id' => 'asc'])
->select()
->bindAttr('category', ['category_name' => 'name'])
- ->hidden(['category_id', 'category']);
+ ->hidden(['category_id', 'category'])
+ ->each(function($item) use($image_host) {
+ if (!empty($item["cover_image"])) {
+ $item["cover_image"] = url_join($image_host, $item["cover_image"]);
+ }
+ if (!empty($item["video_img"])) {
+ $item["video_img"] = url_join($image_host, $item["video_img"]);
+ }
+ if (!empty($item["video_url"])) {
+ $item["video_url"] = url_join($image_host, $item["video_url"]);
+ }
+ });
if (!$products->isEmpty()) {
// 产品参数
diff --git a/app/common.php b/app/common.php
index 5e356e96..f15ba098 100644
--- a/app/common.php
+++ b/app/common.php
@@ -190,4 +190,37 @@ if (!function_exists('url_filesystem_detect')) {
return $url;
}
+}
+
+if (!function_exists('url_join')) {
+ /**
+ * 合并URL
+ * @param string $url 基础URL
+ * @param string $path 路径
+ * @param bool $remove_slash 是否移除首尾的斜杠
+ * @return string
+ */
+ function url_join(string $url, string $path, bool $remove_slash = true): string
+ {
+ if (empty($url)) {
+ return $path;
+ }
+ if (empty($path)) {
+ return $url;
+ }
+ if (\think\helper\Str::startsWith($path, ['http://', 'https://', '//'])) {
+ return $path;
+ }
+
+ if ($remove_slash) {
+ if (str_ends_with($url, '/') && str_starts_with($path, '/')) {
+ return $url . substr($path, 1);
+ }
+ if (!str_ends_with($url, '/') && !str_starts_with($path, '/')) {
+ return $url . '/' . $path;
+ }
+ }
+
+ return $url . $path;
+ }
}
\ No newline at end of file
From a55ffd1e1f6e7dc3ec76d888a6c8c8ac2c5d1240 Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Wed, 6 Aug 2025 11:56:53 +0800
Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E5=90=8E=E5=8F=B0=20-=20=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E5=90=84=E5=AF=BC=E5=87=BA=E5=9B=BE=E7=89=87=E7=AD=89?=
=?UTF-8?q?=E6=96=87=E4=BB=B6=E5=9C=B0=E5=9D=80=E6=8B=BC=E6=8E=A5=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/controller/v1/Article.php | 4 ++--
app/admin/controller/v1/BannerItem.php | 16 ++++++++++------
app/admin/controller/v1/Video.php | 13 +++----------
3 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/app/admin/controller/v1/Article.php b/app/admin/controller/v1/Article.php
index 4c4adf55..53ba5430 100644
--- a/app/admin/controller/v1/Article.php
+++ b/app/admin/controller/v1/Article.php
@@ -228,7 +228,7 @@ class Article
private function getExportArticleData()
{
$server = request()->server();
- $image_host = $server['REQUEST_SCHEME'] . "://" . $server['SERVER_NAME'] . config('filesystem.disks.public.url') . '/';
+ $image_host = $server['REQUEST_SCHEME'] . "://" . $server['SERVER_NAME'] . '/';
$param = request()->param(['title', 'category_id', 'release_time']);
$data = ArticleModel::field([
'*',
@@ -253,7 +253,7 @@ class Article
])
->bindAttr('category', ['category_name' => 'name'])
->each(function ($item) use($image_host) {
- $item->image = !empty($item->image) ? $image_host . $item->image : '';
+ $item->image = !empty($item->image) ? url_join($image_host, $item->image) : '';
return $item;
});
diff --git a/app/admin/controller/v1/BannerItem.php b/app/admin/controller/v1/BannerItem.php
index b1936dcc..3b196d14 100644
--- a/app/admin/controller/v1/BannerItem.php
+++ b/app/admin/controller/v1/BannerItem.php
@@ -262,11 +262,9 @@ class BannerItem
// 获取导出数据
private function getBannerExportData()
{
- $param = request()->param([
- 'title',
- 'banner_id',
- 'created_at'
- ]);
+ $server = request()->server();
+ $image_host = $server['REQUEST_SCHEME'] . "://" . $server['SERVER_NAME'] . '/';
+ $param = request()->param(['title', 'banner_id', 'created_at']);
return SysBannerItemModel::alias('item')
->field([
'item.id',
@@ -311,7 +309,13 @@ class BannerItem
}
})
->order(['item.sort' => 'asc', 'item.id' => 'desc'])
- ->select();
+ ->select()
+ ->each(function($item) use($image_host) {
+ $item->image = !empty($item->image) ? url_join($image_host, $item->image) : '';
+ $item->extra_image = !empty($item->extra_image) ? url_join($image_host, $item->extra_image) : '';
+ $item->video = !empty($item->video) ? url_join($image_host, $item->video) : '';
+ return $item;
+ });
}
// 删除
diff --git a/app/admin/controller/v1/Video.php b/app/admin/controller/v1/Video.php
index 6ec0586b..c392424f 100644
--- a/app/admin/controller/v1/Video.php
+++ b/app/admin/controller/v1/Video.php
@@ -209,9 +209,6 @@ class Video
]);
$domain = request()->domain();
- $image_path = Config::get('filesystem.disks.image.url');
- $video_path = Config::get('filesystem.disks.video.url');
-
return VideoModel::withoutField([
'language_id',
'updated_at',
@@ -230,13 +227,9 @@ class Video
->select()
->bindAttr('category', ['category_name' => 'name'])
->hidden(['category_id', 'category'])
- ->each(function ($item) use($domain, $image_path, $video_path) {
- if (!empty($item->image)) {
- $item->image = $domain . $image_path . '/' . $item->image;
- }
- if (!empty($item->video)) {
- $item->video = $domain . $video_path . '/' . $item->video;
- }
+ ->each(function ($item) use($domain) {
+ $item->image = !empty($item->image) ? url_join($domain, $item->image) : '';
+ $item->video = !empty($item->video) ? url_join($domain, $item->video) : '';
$item->recommend = $item->recommend == 1 ? '是' : '否';
$item->status = $item->status == 1 ? '启用' : '禁用';
return $item;
From c8363dafd155a1ce532db01dd0603e33539ce41d Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Wed, 6 Aug 2025 15:35:35 +0800
Subject: [PATCH 6/7] =?UTF-8?q?perf=20openapi=20=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E5=9C=B0=E5=9D=80=E6=8B=BC=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/openapi/common.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/openapi/common.php b/app/openapi/common.php
index e31187a6..c38dad1c 100644
--- a/app/openapi/common.php
+++ b/app/openapi/common.php
@@ -18,7 +18,7 @@ if (!function_exists('image_domain_concat')) {
return $path;
}
- return rtrim($domain, '/') . '/' . ltrim($path, '/');
+ return url_join($domain, $path);
}
}
@@ -39,7 +39,7 @@ if (!function_exists('video_domain_concat')) {
return $path;
}
- return rtrim($domain, '/') . '/' . ltrim($path, '/');
+ return url_join($domain, $path);
}
}
From 2265be9fbd60c2d908ada253005f2f7ef1086f53 Mon Sep 17 00:00:00 2001
From: jsasg <735273025@qq.com>
Date: Thu, 7 Aug 2025 10:03:50 +0800
Subject: [PATCH 7/7] =?UTF-8?q?fix:=20mobile=20-=20=20=E5=BA=95=E9=83=A8?=
=?UTF-8?q?=E2=80=9C=E8=81=94=E7=B3=BB=E6=88=91=E4=BB=AC=E2=80=9D=E5=8F=96?=
=?UTF-8?q?=E5=80=BC=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/index/view/mobile/public/footer.html | 13 +++++++------
app/index/view/pc/public/footer.html | 2 +-
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/app/index/view/mobile/public/footer.html b/app/index/view/mobile/public/footer.html
index 1374d1ac..858a0624 100644
--- a/app/index/view/mobile/public/footer.html
+++ b/app/index/view/mobile/public/footer.html
@@ -29,12 +29,13 @@
{/notempty}
{:lang_i18n('联系方式')}
- {notempty name="contact_config.website_email"}
- {$contact_config.website_email.title}: {$contact_config.website_email.value}
- {/notempty}
- {notempty name="contact_config.website_hotline_office_hours"}
- {$contact_config.website_hotline_office_hours.title}: {$contact_config.website_hotline_office_hours.value}
- {/notempty}
+ {if condition="!empty($contact_config)"}
+ {volist name="contact_config" id="vo"}
+ {if condition="$vo.type != 'image'"}
+ {$vo.value}
+ {/if}
+ {/volist}
+ {/if}
diff --git a/app/index/view/pc/public/footer.html b/app/index/view/pc/public/footer.html
index 86821864..41bb2923 100644
--- a/app/index/view/pc/public/footer.html
+++ b/app/index/view/pc/public/footer.html
@@ -58,7 +58,7 @@
{else/}
{$vo.value}
- {/if}
+ {/if}
{/volist}