|
|
|
@ -41,11 +41,18 @@ app.post('/createShortcut', (req, res) => {
|
|
|
|
|
|
|
|
|
|
// linux下创建快捷方式
|
|
|
|
|
const shortcutFolderPath = path.join(folderPath, `${shortcutName}.desktop`);
|
|
|
|
|
// const shortcutFileContent = `[Desktop Entry]
|
|
|
|
|
// Type=Application
|
|
|
|
|
// Name=${shortcutName}
|
|
|
|
|
// Exec=/usr/bin/chromium-browser ${shortcutURL}
|
|
|
|
|
// Icon=/usr/share/icons/hicolor/48x48/apps/chromium-browser.png`;
|
|
|
|
|
|
|
|
|
|
// arm 下用火狐打开
|
|
|
|
|
const shortcutFileContent = `[Desktop Entry]
|
|
|
|
|
Type=Application
|
|
|
|
|
Name=${shortcutName}
|
|
|
|
|
Exec=/usr/bin/chromium-browser ${shortcutURL}
|
|
|
|
|
Icon=/usr/share/icons/hicolor/48x48/apps/chromium-browser.png`;
|
|
|
|
|
Exec=sudo /usr/bin/firefox-esr ${shortcutURL}
|
|
|
|
|
Icon=/usr/share/icons/hicolor/48x48/apps/firefox-esr.png`;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
fs.writeFileSync(shortcutFolderPath, shortcutFileContent);
|
|
|
|
|