From 63356549049cd278fc64f7b883d4cd249a00b7fa Mon Sep 17 00:00:00 2001 From: cc Date: Thu, 25 Jun 2026 19:42:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=8A=E4=BC=A0=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E6=94=B9=E6=8C=89=E9=9C=80(>1MB)=20+=20=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=206340=20=E5=85=9C=E5=BA=95?= =?UTF-8?q?=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PhotoWallPage: 仅当原文件 >1MB 才 Canvas 压缩,小图原样上传 - auth.rs: seed 兜底表新增 UserTest6340(本地无 DB 时用;线上走 wall_users 表) Co-Authored-By: Claude Opus 4.8 --- Client/src/components/PhotoWallPage.tsx | 4 ++-- Server/src/auth.rs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Client/src/components/PhotoWallPage.tsx b/Client/src/components/PhotoWallPage.tsx index 0100a82..fd905b5 100644 --- a/Client/src/components/PhotoWallPage.tsx +++ b/Client/src/components/PhotoWallPage.tsx @@ -551,8 +551,8 @@ export function PhotoWallPage({ onExit, token, folderName, isAdmin, onForbidden showToast(`已达上限(${maxItems} 条)`) return } - // 客户端压缩(大图缩小 + 转 JPEG q=0.78) - const src = await compressImage(rawSrc) + // 客户端压缩:仅当原文件 > 1MB 时才压(大图缩小 + 转 JPEG q=0.78),小图原样上传 + const src = file.size > 1024 * 1024 ? await compressImage(rawSrc) : rawSrc const uploadFn = isPersonal ? (t: string, d: string) => uploadPhoto(t, d) : (t: string, d: string) => uploadFolderPhoto(t, folderName!, d) diff --git a/Server/src/auth.rs b/Server/src/auth.rs index 595f81f..69350d6 100644 --- a/Server/src/auth.rs +++ b/Server/src/auth.rs @@ -222,6 +222,11 @@ impl WallUserStore { "UserTest".to_string(), "76f03f2eaa05e66c82d25e168fec27e7d0d202f15da73aa5852562f863633b8e".to_string(), ); + // UserTest6340 / 2019.01.6340 + users.insert( + "UserTest6340".to_string(), + "c7780d075f561283ae4665a64d8b8e2642389ad948390a542b847833a7ce7c1a".to_string(), + ); WallUserStore::Memory(users) }