(cache)
| 77 | } |
| 78 | |
| 79 | function writeTokenCache(cache) { |
| 80 | try { |
| 81 | fs.writeFileSync(TOKEN_CACHE_FILE, JSON.stringify(cache, null, 2), "utf8"); |
| 82 | } catch (e) { |
| 83 | $.log(`写入token缓存失败: ${e.message || e}`); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | function isTokenError(message) { |
| 88 | return /token|登录|授权|invalid|expire|过期|1041|401|403/i.test(String(message || "")); |
no test coverage detected