完善客户端模块与工作区能力
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user