From d9ba811d60810a8cd5e2eddaaa4decf6c6972f22 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Sat, 14 Jun 2025 11:35:56 +0800
Subject: [PATCH] feat:优化

---
 src/utils/util.js |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/utils/util.js b/src/utils/util.js
index 978bddf..8fe922e 100644
--- a/src/utils/util.js
+++ b/src/utils/util.js
@@ -120,6 +120,16 @@
   })
 }
 /**
+ * 获取缩略图路径
+ * @param url
+ * @returns {string}
+ */
+export const getSmallImg = url => {
+	if (!url) return ''
+	const lastDotIndex = url.lastIndexOf('.')
+	return `${url.substring(0, lastDotIndex)}_small${url.substring(lastDotIndex)}`
+}
+/**
  * 浏览器判断是否全屏
  */
 export const fullscreenEnable = () => {
@@ -428,3 +438,13 @@
   // 设置默认范围 [上个月, 当前月]
   return [new Date(lastMonthYear, lastMonth, 1), new Date(currentYear, currentMonth, 1)]
 }
+/**
+ * 获取中等缩略图路径
+ * @param url
+ * @returns {string}
+ */
+export const getShowImg = url => {
+	if (!url) return ''
+	const lastDotIndex = url.lastIndexOf('.')
+	return `${url.substring(0, lastDotIndex)}_show${url.substring(lastDotIndex)}`
+}
\ No newline at end of file

--
Gitblit v1.9.3