* 删除 session
(sessionId: string)
| 307 | * 删除 Session |
| 308 | */ |
| 309 | async deleteSession(sessionId: string): Promise<void> { |
| 310 | // 删除 Session 文件 |
| 311 | const sessionPath = this.getSessionPath(sessionId); |
| 312 | if (fs.existsSync(sessionPath)) { |
| 313 | fs.unlinkSync(sessionPath); |
| 314 | } |
| 315 | |
| 316 | // 从索引中移除 |
| 317 | const index = this.readIndex(); |
| 318 | index.sessions = index.sessions.filter(s => s.id !== sessionId); |
| 319 | this.writeIndex(index); |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * 清空所有 Session |
no test coverage detected