Commit 6a9b583b authored by guxukai's avatar guxukai

Merge branch '2.5.0_fix' into '2.5.0'

fix: 上传限制1m See merge request !1
parents 49ef0dce 78845bee
......@@ -266,6 +266,10 @@ export const uploadFile = async (target, targetFolder: string, cb?: (err: Error,
if (
file.type === 'application/zip'
) {
if (file.size / 1024 > 1024) {
return dispatch(displayNotification('File Upload Failed', '压缩文件大于1M', 'Close', null, async () => {
}))
}
return await iterator(await unZipFile(file))
}
const workspaceProvider = plugin.fileProviders.workspace
......@@ -293,7 +297,6 @@ export const uploadFile = async (target, targetFolder: string, cb?: (err: Error,
cb && cb(null, true)
}
const name = `${targetFolder}/${isFolder ? file.webkitRelativePath : file.name}`
workspaceProvider.exists(name).then(exist => {
if (!exist) {
loadFile(name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment