Commit 78845bee authored by gxkai's avatar gxkai

fix: 上传限制1m

parent 49ef0dce
......@@ -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