完善客户端模块与工作区能力
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-13 19:45:30 +08:00
parent 0148b91a15
commit 22add3f01f
97 changed files with 4756 additions and 3226 deletions

View File

@@ -13,6 +13,11 @@ import { getProviderService } from '../services/providers/provider-service';
import type { ProviderConfig } from '../utils/secure-storage';
import type { ProviderAccount } from '../shared/providers/types';
import { validateApiKeyWithProvider } from '../services/providers/provider-validation';
import {
isAdminSessionUnlocked,
lockAdminSession,
verifyAdminPassword,
} from './admin-access';
type UnifiedRequest = {
id?: string;
@@ -282,6 +287,15 @@ export function registerIpcHandlers(
return { success: true, settings: await getAllSettings() };
});
ipcMain.handle('admin:verifyPassword', (_event, password: unknown) => ({
success: verifyAdminPassword(password),
}));
ipcMain.handle('admin:isUnlocked', () => isAdminSessionUnlocked());
ipcMain.handle('admin:lock', () => {
lockAdminSession();
return { success: true };
});
ipcMain.handle('shell:openExternal', (_event, url: string) => shell.openExternal(url));
ipcMain.handle('shell:showItemInFolder', (_event, path: string) => shell.showItemInFolder(path));
ipcMain.handle('shell:openPath', (_event, path: string) => shell.openPath(path));