This commit is contained in:
yj 2024-08-08 14:23:56 +08:00
parent 891a435ff0
commit c341100d5d
1 changed files with 6 additions and 14 deletions

View File

@ -284,7 +284,6 @@ 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}"`);
@ -292,13 +291,6 @@ const SharedFilesModel = forwardRef((props: any, ref: any) => {
exec(`open "${setting.shareFilesPath}"`);
}
getRoomFile()
} catch (error: any) {
if (error.code === 'ENOENT') {
message.error('文件夹不存在!')
} else {
message.error(error)
}
}
} catch (error: any) {
if (error.code === 'ENOENT') {
message.error('文件夹不存在!')