From f4ca2101b5f88dd9cc5b47140276b9615df88908 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:54:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B012?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodeService.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nodeService.js b/nodeService.js index 01652bb..1971414 100644 --- a/nodeService.js +++ b/nodeService.js @@ -45,7 +45,7 @@ app.post('/createShortcut', (req, res) => { Type=Application Name=${shortcutName} Exec=/usr/bin/chromium-browser ${shortcutURL} - Icon=Icon=/usr/share/icons/hicolor/48x48/apps/chromium-browser.png`; + Icon=/usr/share/icons/hicolor/48x48/apps/chromium-browser.png`; fs.writeFile(shortcutFolderPath, shortcutFileContent, (err) => { if (err) { @@ -56,7 +56,8 @@ app.post('/createShortcut', (req, res) => { } }); - fs.chmodSync(shortcutFolderPath, 0o755); + // 设置文件权限为可执行 + fs.chmodSync(shortcutFolderPath, 0o755); // 0o755 表示 rwxr-xr-x 权限,即所有者可读写执行,其他用户可读执行 }); // 运行项目 需要进入到当前的文件夹目录打开终端 执行 node nodeService.js