(cache)
| 43 | } |
| 44 | |
| 45 | function writeTokenCache(cache) { |
| 46 | try { |
| 47 | fs.writeFileSync(TOKEN_CACHE_FILE, JSON.stringify(cache, null, 2), "utf8"); |
| 48 | } catch (e) { |
| 49 | $.log(`写入token缓存失败: ${e.message || e}`); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | function sha1(text) { |
| 54 | return crypto.createHash("sha1").update(String(text)).digest("hex"); |
no test coverage detected