koishi-plugin-jscn-aaaquery 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +0 -16
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -258,25 +258,9 @@ function apply(ctx, config) {
|
|
|
258
258
|
console.log("使用缓存的token,过期时间:", new Date(tokenExpireTime).toLocaleString());
|
|
259
259
|
return currentToken;
|
|
260
260
|
}
|
|
261
|
-
if (currentToken && now < tokenExpireTime) {
|
|
262
|
-
console.log("token即将过期,后台刷新token");
|
|
263
|
-
refreshTokenInBackground();
|
|
264
|
-
return currentToken;
|
|
265
|
-
}
|
|
266
261
|
return refreshToken(currentSession);
|
|
267
262
|
}
|
|
268
263
|
__name(getToken, "getToken");
|
|
269
|
-
async function refreshTokenInBackground() {
|
|
270
|
-
try {
|
|
271
|
-
console.log("开始在后台刷新token...");
|
|
272
|
-
refreshToken().catch((error) => {
|
|
273
|
-
console.error("后台刷新token失败:", error);
|
|
274
|
-
});
|
|
275
|
-
} catch (error) {
|
|
276
|
-
console.error("启动后台刷新token失败:", error);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
__name(refreshTokenInBackground, "refreshTokenInBackground");
|
|
280
264
|
const captchaPendingMap = /* @__PURE__ */ new Map();
|
|
281
265
|
const CAPTCHA_TIMEOUT = 5 * 60 * 1e3;
|
|
282
266
|
setInterval(() => {
|