(cache)
| 56 | } |
| 57 | |
| 58 | function writeTokenCache(cache) { |
| 59 | try { |
| 60 | fs.writeFileSync(TOKEN_CACHE_FILE, JSON.stringify(cache, null, 2), "utf8"); |
| 61 | } catch (e) { |
| 62 | $.log(`写入token缓存失败: ${e.message || e}`); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | function shortToken(token = "") { |
| 67 | const value = String(token).replace(/^bearer\s+/i, ""); |
no test coverage detected