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