From b14daae31c57704b2679e1efbf3e80d118037ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E8=AA=89=E7=A8=8B?= <2659568239@qq.com> Date: Thu, 22 Feb 2024 16:11:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B010?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodeService.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nodeService.js b/nodeService.js index 7a82fa1..b437fe5 100644 --- a/nodeService.js +++ b/nodeService.js @@ -28,7 +28,7 @@ app.post('/createShortcut', (req, res) => { // window下用.url // const shortcutFilePath = path.join(folderPath, `${shortcutName}.url`); // linux中用.desktop - const shortcutFilePath = path.join(folderPath, `${shortcutName}test.desktop`); + const shortcutFilePath = path.join(folderPath, `${shortcutName}.desktop`); // 删除旧的快捷方式文件(如果存在) if (fs.existsSync(shortcutFilePath)) { @@ -40,12 +40,12 @@ app.post('/createShortcut', (req, res) => { // const shortcutFileContent = `[InternetShortcut]\nURL=${shortcutURL}`; // linux下创建快捷方式 - const shortcutFolderPath = path.join(folderPath, `${shortcutName}test.desktop`); + const shortcutFolderPath = path.join(folderPath, `${shortcutName}.desktop`); const shortcutFileContent = `[Desktop Entry] Type=Application Name=${shortcutName} - Exec=xdg-open ${shortcutURL} - Icon=chromium-browser`; + Exec=/usr/bin/chromium-browser ${shortcutURL} + Icon=Icon=/usr/share/icons/hicolor/48x48/apps/chromium-browser.png`; fs.writeFile(shortcutFolderPath, shortcutFileContent, (err) => { if (err) {