This commit is contained in:
parent
891a435ff0
commit
c341100d5d
|
|
@ -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('文件夹不存在!')
|
||||
|
|
|
|||
Loading…
Reference in New Issue