MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / initializeCliForAccount

Method initializeCliForAccount

src/utils/account.js:974–987  ·  view source on GitHub ↗

* 为指定账户初始化CLI信息(公共方法) * @param {Object} account - 账户对象 * @returns {Promise } 初始化是否成功

(account)

Source from the content-addressed store, hash-verified

972 }
973
974 // 旧代理 URL 不再被该账户引用,主动失效缓存
975 // 注意:其他账户可能仍在使用同一 URL,但 invalidate 仅按 URL 操作;
976 // 多账户共享代理的场景下后续请求会重新创建 agent,安全
977 if (oldProxy && oldProxy !== newProxy) {
978 const { invalidateProxyAgent } = require('./proxy-helper')
979 invalidateProxyAgent(oldProxy)
980 }
981
982 logger.success(`账户 ${email} 代理更新成功 (${oldProxy || '无'} → ${newProxy || '无'})`, 'ACCOUNT')
983 return true
984 } catch (error) {
985 logger.error(`更新账户 ${email} 代理失败`, 'ACCOUNT', '', error)
986 return false
987 }
988 }
989
990 /**

Callers

nothing calls this directly

Calls 2

_initializeCliAccountMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected