diff --git a/src/components/UserVideo/index.module.scss b/src/components/UserVideo/index.module.scss index b1d7b15..c08ae26 100644 --- a/src/components/UserVideo/index.module.scss +++ b/src/components/UserVideo/index.module.scss @@ -65,7 +65,7 @@ height: 0; .userVideoContentListItem { - height: 13%; + height: 24%; width: calc(100% / 3 - 8px); padding: 4px; diff --git a/src/page/Home/User/index.tsx b/src/page/Home/User/index.tsx index a48a247..0818734 100644 --- a/src/page/Home/User/index.tsx +++ b/src/page/Home/User/index.tsx @@ -79,43 +79,36 @@ const User: React.FC = () => { } const fileUpLoad = async (data: { url: string, content: string, fileName: string }): Promise => { const setting = await JSON.parse(storage.getItem('setting') as string) - if (setting.isShareSavePath) { - window.electron.selectFilePath({ - fileName: data.fileName, - filePath: data.url - }) - } else { - try { - const response = await fetch(data.url); - const arrayBuffer = await response.arrayBuffer(); - const buffer = Buffer.from(arrayBuffer); - await fs.writeFile(`${setting.shareFilesPath}\\${data.fileName}`, buffer, {}); - setChangeImportModal(false) - confirm({ - title: '提示', - icon: , - content: data.content, - centered: true, - okText: '打开文件夹', - cancelText: '关闭', - async onOk() { - 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}"`); - } - }, - onCancel() { + try { + const response = await fetch(data.url); + const arrayBuffer = await response.arrayBuffer(); + const buffer = Buffer.from(arrayBuffer); + await fs.writeFile(`${setting.shareFilesPath}\\${data.fileName}`, buffer, {}); + setChangeImportModal(false) + confirm({ + title: '提示', + icon: , + content: data.content, + centered: true, + okText: '打开文件夹', + cancelText: '关闭', + async onOk() { + 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}"`); } - }) - } catch (error: any) { - if (error.code === 'ENOENT') { - message.error('文件夹不存在!') - return - } else { - message.error(error) + }, + onCancel() { } + }) + } catch (error: any) { + if (error.code === 'ENOENT') { + message.error('文件夹不存在!') + return + } else { + message.error(error) } } }