✨ feat(upload): 支持后台配置上传分片大小

This commit is contained in:
orion committed 2026-09-18 17:50:43 +08:00
1 parent 5b78ec6fbc
commit 272741ee49
11 files changed
+64 -5

No files matched your search

+5 -1
View File
@@ -7,6 +7,7 @@ export type PublicConfig = SystemConfig & {
openUpload: number
max_save_seconds: number
enableChunk: number
chunkSizeMB: number
notify_title?: string
notify_content?: string
page_explain?: string
@@ -22,7 +23,8 @@ export const DEFAULT_PUBLIC_CONFIG: PublicConfig = {
expireStyle: ['day'],
openUpload: 1,
max_save_seconds: 0,
enableChunk: 0
enableChunk: 0,
chunkSizeMB: 90
}
export const DEFAULT_CONFIG_STATE: ConfigState = {
@@ -44,6 +46,7 @@ export const DEFAULT_CONFIG_STATE: ConfigState = {
trashRetentionDays: 30,
opacity: 0.9,
enableChunk: DEFAULT_PUBLIC_CONFIG.enableChunk,
chunkSizeMB: DEFAULT_PUBLIC_CONFIG.chunkSizeMB,
s3_access_key_id: '',
background: '',
showAdminAddr: 0,
@@ -85,6 +88,7 @@ export function toPublicConfig(config: Partial<ConfigState> | null | undefined):
openUpload: config.openUpload,
max_save_seconds: config.max_save_seconds,
enableChunk: config.enableChunk,
chunkSizeMB: config.chunkSizeMB ?? DEFAULT_PUBLIC_CONFIG.chunkSizeMB,
notify_title: config.notify_title,
notify_content: config.notify_content,
page_explain: config.page_explain,