* 刷新 SSXMOD Cookie
()
| 23 | */ |
| 24 | function getSsxmodForAccount(account) { |
| 25 | const email = account && account.email; |
| 26 | if (!email) { |
| 27 | // Fallback for calls without account context — use a synthetic key |
| 28 | return getOrGenerate('__global__'); |
| 29 | } |
| 30 | return getOrGenerate(email); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Internal: get from cache or generate fresh cookies. |
| 35 | * @param {string} key |
| 36 | * @returns {{ssxmod_itna: string, ssxmod_itna2: string}} |
| 37 | */ |
| 38 | function evictOldestSsxmod() { |
| 39 | if (accountCache.size <= MAX_CACHE_SIZE) return; |
| 40 | const oldestKey = accountCache.keys().next().value; |
no test coverage detected