Skip to content

Commit 9bbc2c7

Browse files
committed
顺序调整
1 parent 3a7ff94 commit 9bbc2c7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/upload/resume.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ export default class Resume extends Base {
144144
return
145145
}
146146

147-
if (cachedInfo) {
148-
// 有缓存但是没有使用,设置标记为 false
149-
this.usedCacheList[index] = false
150-
}
147+
// 没有使用缓存设置标记为 false
148+
this.usedCacheList[index] = false
151149

152150
const onProgress = (data: Progress) => {
153151
this.updateChunkProgress(data.loaded, index)
@@ -188,6 +186,7 @@ export default class Resume extends Base {
188186
const data: UploadChunkBody = {
189187
parts: this.uploadedList.map((value, index) => ({
190188
etag: value.etag,
189+
// 接口要求 index 需要从 1 开始,所以需要整体 + 1
191190
partNumber: index + 1
192191
})),
193192
fname: this.putExtra.fname,
@@ -227,17 +226,17 @@ export default class Resume extends Base {
227226
this.key,
228227
this.uploadHost!.getUrl()
229228
)
230-
this.logger.info(`init upload parts of id: ${res.data.uploadId}.`)
229+
this.logger.info(`initd upload parts of id: ${res.data.uploadId}.`)
231230
this.uploadId = res.data.uploadId
232231
this.cachedUploadedList = []
233232
} else {
234233
const infoMessage = [
235-
'resume upload parts from local cache',
236-
`total ${cachedInfo.data.length} part`,
234+
'resume upload parts from local cache,',
235+
`total ${cachedInfo.data.length} part,`,
237236
`id is ${cachedInfo.id}.`
238237
]
239238

240-
this.logger.info(infoMessage.join(', '))
239+
this.logger.info(infoMessage.join(' '))
241240
this.cachedUploadedList = cachedInfo.data
242241
this.uploadId = cachedInfo.id
243242
}

0 commit comments

Comments
 (0)