(cache)
| 195 | } |
| 196 | |
| 197 | function writeCache(cache) { |
| 198 | try { |
| 199 | fs.writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2), "utf8"); |
| 200 | } catch (e) { |
| 201 | $.log(`写入token缓存失败: ${e.message || e}`); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | function shortToken(token = "") { |
| 206 | const value = String(token).replace(/^Bearer\s+/i, ""); |
no test coverage detected