feat: electron only

This commit is contained in:
shano
2025-09-10 01:11:06 +08:00
parent 2a8d0f2066
commit 08f7e5adfe
5 changed files with 37 additions and 18 deletions

View File

@@ -275,6 +275,28 @@ export function initializeFileManager() {
}
}
});
// 搜索建议
ipcMain.handle('get-search-suggestions', async (_, keyword: string) => {
if (!keyword || !keyword.trim()) {
return [];
}
try {
console.log(`[Main Process Proxy] Forwarding suggestion request for: ${keyword}`);
const response = await axios.get('http://msearchcdn.kugou.com/new/app/i/search.php', {
params: {
cmd: 302,
keyword: keyword,
},
timeout: 5000
});
return response.data;
} catch (error: any) {
console.error('[Main Process Proxy] Failed to fetch search suggestions:', error.message);
return [];
}
});
}
/**