diff --git a/src/components/SharedFilesModel/index.tsx b/src/components/SharedFilesModel/index.tsx index b193f21..3b38744 100644 --- a/src/components/SharedFilesModel/index.tsx +++ b/src/components/SharedFilesModel/index.tsx @@ -284,21 +284,13 @@ const SharedFilesModel = forwardRef((props: any, ref: any) => { const buffer = Buffer.from(arrayBuffer); fs.writeFile(`${setting.shareFilesPath}${fileItem[fileIndex].fileName}`, buffer, {}); message.success(`下载成功!文件已保存至:${setting.shareFilesPath}`) - try { - await fs.access(setting.shareFilesPath, fs.constants.F_OK); - if (process.platform === 'win32') { - exec(`explorer "${setting.shareFilesPath}"`); - } else if (process.platform === 'darwin') { - exec(`open "${setting.shareFilesPath}"`); - } - getRoomFile() - } catch (error: any) { - if (error.code === 'ENOENT') { - message.error('文件夹不存在!') - } else { - message.error(error) - } + await fs.access(setting.shareFilesPath, fs.constants.F_OK); + if (process.platform === 'win32') { + exec(`explorer "${setting.shareFilesPath}"`); + } else if (process.platform === 'darwin') { + exec(`open "${setting.shareFilesPath}"`); } + getRoomFile() } catch (error: any) { if (error.code === 'ENOENT') { message.error('文件夹不存在!')