feat: 完善剩余功能

This commit is contained in:
ethan.chen
2025-11-05 14:24:15 +08:00
parent f67a3835fa
commit 73945c40e5
8 changed files with 105 additions and 59 deletions

View File

@@ -267,7 +267,7 @@ function createWindow(frontendUrl, frontendPort, backendPort, isDev) {
* @returns {Array} 菜单模板数组
*/
function getMenuTemplate() {
return [
const res = [
{
label: i18next.t("menu.lockWindow"),
click: () => {
@@ -286,12 +286,6 @@ function createWindow(frontendUrl, frontendPort, backendPort, isDev) {
mainWindow.reload();
},
},
{
label: i18next.t("menu.openDevTools"),
click: () => {
mainWindow.webContents.openDevTools();
},
},
{
label: i18next.t("menu.language"),
submenu: [
@@ -339,6 +333,16 @@ function createWindow(frontendUrl, frontendPort, backendPort, isDev) {
},
},
];
if (isDev) {
res.push({
label: i18next.t("menu.openDevTools"),
click: () => {
mainWindow.webContents.openDevTools();
searchWindow && searchWindow.webContents.openDevTools();
},
});
}
return res;
}
/**