fix(ilanzou): fix upload failure for small files #7368
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复问题: #7250
问题原因: 在通过
/7n/getUpToken
接口获取token
时,如果请求传参中的文件KB
数fileSize
字段为0,则会报错;而对于上传小于1024 Byte
的文件时,目前是按1024
整除得到的结果,也就是0
,导致无法获取到token
,从而中断了上传流程。修复方案: 调研了蓝奏云优享版的
/7n/getUpToken
接口,发现他们在将字节数转为KB
数时是向上取整的,所以改成向上取整应该可以解决,避免了计算结果为0
的情况。