(key: string, value: string)
| 104 | static async set(key: string, value: string): Promise<boolean> { |
| 105 | await this.init(); |
| 106 | if (!this.db) return false; |
| 107 | try { |
| 108 | this.db.data[key] = value; |
| 109 | await this.db.write(); |
| 110 | return true; |
| 111 | } catch (error) { |
| 112 | console.error(`[git] 设置配置失败 ${key}:`, error); |
| 113 | return false; |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | // 统一创建 GitHub API 客户端 |
| 119 | async function getApi() { |
| 120 | const baseURL = await ConfigManager.get(CONFIG_KEYS.API_BASE_URL); |
no test coverage detected