(account)
| 179 | } |
| 180 | |
| 181 | async function getAccessToken(account) { |
| 182 | const value = account.trim(); |
| 183 | if (isToken(value)) { |
| 184 | $.log(`ℹ️ 检测到旧token变量,将直接使用: ${maskToken(value)}`); |
| 185 | return value; |
| 186 | } |
| 187 | |
| 188 | const cache = readCache(); |
| 189 | const cachedToken = cache[value]?.token; |
| 190 | if (cachedToken) { |
| 191 | $.log(`🔎 使用缓存token校验: ${maskToken(cachedToken)}`); |
| 192 | if (await validateToken(value, cachedToken)) { |
| 193 | $.log("✅ 缓存token有效"); |
| 194 | return cachedToken; |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | return loginByCode(value); |
| 199 | } |
| 200 | |
| 201 | // ================== 核心逻辑 ================== |
| 202 | async function signIn(account, index) { |
no test coverage detected