(cache)
| 41 | } |
| 42 | |
| 43 | function writeTokenCache(cache) { |
| 44 | try { |
| 45 | fs.writeFileSync(TOKEN_CACHE_FILE, JSON.stringify(cache, null, 2), "utf8"); |
| 46 | } catch (e) { |
| 47 | $.log(`写入token缓存失败: ${e.message || e}`); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | function isTokenError(message) { |
| 52 | return /token|授权|登录|401|403|expire|过期|失效/i.test(String(message || "")); |
no test coverage detected