Feat: Update Home Page Styles

更新首页 UI
This commit is contained in:
2026-05-20 21:34:56 +08:00
parent 7d0ac45e8a
commit 81deef7374
4 changed files with 71 additions and 31 deletions
+21
View File
@@ -0,0 +1,21 @@
const { APP_BACKEND_EXT_URL } = import.meta.env;
// 获取图片缩略图
export const getImageThumbUrl = (
url: string,
{ width = 500, height = 500 }: { width?: number; height?: number } = {}
) => {
// 确保不会出错
if (!APP_BACKEND_EXT_URL) {
return url;
}
const extUrl = new URL(APP_BACKEND_EXT_URL);
extUrl.pathname = `/api/image-compress/${new URL(
url.replace(".mp4", ".jpg")
).pathname.replace("/upload/", "")}`;
extUrl.searchParams.set("w", String(width || 500));
extUrl.searchParams.set("h", String(height || 500));
return extUrl.toString();
};