(config: {
enabled: boolean
url: string
})
| 597 | |
| 598 | // 设置代理配置 |
| 599 | public async setProxyConfig(config: { |
| 600 | enabled: boolean |
| 601 | url: string |
| 602 | }): Promise<{ success: boolean; error?: string }> { |
| 603 | try { |
| 604 | proxyManager.setProxyConfig(config) |
| 605 | console.log('[Settings] 代理配置已更新:', config) |
| 606 | |
| 607 | // 应用全局代理配置 |
| 608 | await proxyManager.applyProxyToDefaultSession() |
| 609 | |
| 610 | return { success: true } |
| 611 | } catch (error: unknown) { |
| 612 | console.error('[Settings] 设置代理配置失败:', error) |
| 613 | return { success: false, error: error instanceof Error ? error.message : '未知错误' } |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | // 设置窗口默认高度 |
| 618 | public setWindowDefaultHeight(height: number): { success: boolean; error?: string } { |
no test coverage detected