feat: 上传压缩改按需(>1MB) + 特殊文件夹 6340 兜底用户

- PhotoWallPage: 仅当原文件 >1MB 才 Canvas 压缩,小图原样上传
- auth.rs: seed 兜底表新增 UserTest6340(本地无 DB 时用;线上走 wall_users 表)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
cc 2026-06-25 19:42:06 +08:00
parent f4b417bcaf
commit 6335654904
2 changed files with 7 additions and 2 deletions

View File

@ -551,8 +551,8 @@ export function PhotoWallPage({ onExit, token, folderName, isAdmin, onForbidden
showToast(`已达上限(${maxItems} 条)`) showToast(`已达上限(${maxItems} 条)`)
return return
} }
// 客户端压缩(大图缩小 + 转 JPEG q=0.78 // 客户端压缩:仅当原文件 > 1MB 时才压(大图缩小 + 转 JPEG q=0.78,小图原样上传
const src = await compressImage(rawSrc) const src = file.size > 1024 * 1024 ? await compressImage(rawSrc) : rawSrc
const uploadFn = isPersonal const uploadFn = isPersonal
? (t: string, d: string) => uploadPhoto(t, d) ? (t: string, d: string) => uploadPhoto(t, d)
: (t: string, d: string) => uploadFolderPhoto(t, folderName!, d) : (t: string, d: string) => uploadFolderPhoto(t, folderName!, d)

View File

@ -222,6 +222,11 @@ impl WallUserStore {
"UserTest".to_string(), "UserTest".to_string(),
"76f03f2eaa05e66c82d25e168fec27e7d0d202f15da73aa5852562f863633b8e".to_string(), "76f03f2eaa05e66c82d25e168fec27e7d0d202f15da73aa5852562f863633b8e".to_string(),
); );
// UserTest6340 / 2019.01.6340
users.insert(
"UserTest6340".to_string(),
"c7780d075f561283ae4665a64d8b8e2642389ad948390a542b847833a7ce7c1a".to_string(),
);
WallUserStore::Memory(users) WallUserStore::Memory(users)
} }