feat: 更新获取CNB配置的路由,优化参数处理并添加错误处理

This commit is contained in:
xiongxiao
2026-03-09 19:13:20 +08:00
committed by cnb
parent a40c2352bf
commit 7d227d3913
3 changed files with 27 additions and 6 deletions

View File

@@ -45,10 +45,7 @@ export class CNBManager {
return cnbItem
}
async getCNB(opts?: { username?: string, kevisualToken?: string }): Promise<CNBItem | null> {
if (opts?.username) {
return this.getDefaultCNB()
}
const username = opts?.kevisualToken
const username = opts?.username
const cnbItem = this.cnbMap.get(username)
if (cnbItem) {
cnbItem.runAt = Date.now()