|
|
|
@ -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}.desktop`);
|
|
|
|
|
const shortcutFilePath = path.join(folderPath, `${shortcutName}test.desktop`);
|
|
|
|
|
|
|
|
|
|
// 删除旧的快捷方式文件(如果存在)
|
|
|
|
|
if (fs.existsSync(shortcutFilePath)) {
|
|
|
|
@ -40,7 +40,7 @@ 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}test.desktop`);
|
|
|
|
|
const shortcutFileContent = `[Desktop Entry]
|
|
|
|
|
Type=Application
|
|
|
|
|
Name=${shortcutName}
|
|
|
|
|