(pluginPath: string)
| 583 | |
| 584 | // 终止插件并返回搜索页面 |
| 585 | private killPluginAndReturn(pluginPath: string): { success: boolean; error?: string } { |
| 586 | try { |
| 587 | console.log('[Plugins] 终止插件并返回搜索页面:', pluginPath) |
| 588 | if (this.pluginManager) { |
| 589 | const result = this.pluginManager.killPlugin(pluginPath) |
| 590 | if (result) { |
| 591 | windowManager.notifyBackToSearch() |
| 592 | this.mainWindow?.webContents.focus() |
| 593 | return { success: true } |
| 594 | } else { |
| 595 | return { success: false, error: '插件未运行' } |
| 596 | } |
| 597 | } |
| 598 | return { success: false, error: '功能不可用' } |
| 599 | } catch (error: unknown) { |
| 600 | console.error('[Plugins] 终止插件并返回搜索页面失败:', error) |
| 601 | return { success: false, error: error instanceof Error ? error.message : '未知错误' } |
| 602 | } |
| 603 | } |
| 604 | |
| 605 | // 获取插件 README.md 内容 |
| 606 | public async getPluginReadme( |
no test coverage detected