🔧 chore(upload): 将公网 WebDAV 分片调整为 90MB

This commit is contained in:
orion committed 2026-09-18 17:37:22 +08:00
1 parent e7918e9317
commit 5b78ec6fbc
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ import { waitForUploadCompletion, isTransientCompletionError } from './upload-co
import type { ApiResponse, ChunkUploadInitResponse, FileUploadResponse, UploadProgress } from '@/types'
import { calculateFileHash } from '@/utils/file-processing'
export const CHUNK_SIZE = 100 * 1024 * 1024
export const CHUNK_SIZE = 90 * 1024 * 1024
type ChunkedUploadOptions = {
cancellation?: UploadCancellation
+1 -1
View File
@@ -10,7 +10,7 @@ before(async()=>{originalWindow=globalThis.window;globalThis.window={location:{o
after(async()=>{await server?.close();globalThis.window=originalWindow})
async function render(component,props){const context={};const app=createSSRApp({render:()=>h(component,props)});app.use(createI18n({legacy:false,locale:'zh-CN',messages:{'zh-CN':zh}}));return (await renderToString(app,context))+Object.values(context.teleports||{}).join('')}
test('upload area displays actual bytes while sending and verifying',async()=>{
for(const uploadStatus of ['uploading','confirming']){const html=await render(Area,{uploadStatus,uploadedBytes:52428800,totalBytes:104857600,progress:50});assert.ok(html.includes('50 MB / 100 MB'));assert.ok(!html.includes('0 B / 0 B'))}
for(const uploadStatus of ['uploading','confirming']){const html=await render(Area,{uploadStatus,uploadedBytes:52428800,totalBytes:94371840,progress:50});assert.ok(html.includes('50 MB / 90 MB'));assert.ok(!html.includes('0 B / 0 B'))}
})
test('retrieval detail uses accessible shared dialog and exposes entire long filename',async()=>{
const filename='FlClash-'+'long-'.repeat(25)+'android-arm64-v8a.apk';const html=await render(Detail,{visible:true,record:{filename,size:'51.58 MB',date:'2026/09/18 15:08:09',code:'ABCD2345',downloadUrl:'/share/download?code=ABCD2345'}})