From 03ade0b4f958da9e76154bf2d03a3bd044c86bce Mon Sep 17 00:00:00 2001 From: duan602728596 Date: Wed, 23 Aug 2023 14:34:28 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtimers=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=87=BD=E6=95=B0=E7=9A=84=E7=B1=BB=E5=9E=8B=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- .../bilibiliFeedSpace.worker/bilibiliFeedSpace.worker.ts | 2 +- .../QQ/function/expand/douyin/douyin.worker/douyin.worker.ts | 2 +- .../expand/xiaohongshu/xiaohongshu.worker/xiaohongshu.worker.ts | 2 +- .../components/IMLogin/Pocket48Login/function/SMSStore.ts | 2 +- packages/qqtools/src/services/48/jsdelivrCDN/index.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 32d6260a..995d2aea 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "@types/fs-extra": "^11", "@types/js-yaml": "^4", "@types/lodash-es": "^4", - "@types/node": "^18", + "@types/node": "^20", "@types/node-schedule": "^2", "@types/react": "^18", "@types/react-dom": "^18", diff --git a/packages/qqtools/src/QQ/function/expand/bilibili/feedSpace/bilibiliFeedSpace.worker/bilibiliFeedSpace.worker.ts b/packages/qqtools/src/QQ/function/expand/bilibili/feedSpace/bilibiliFeedSpace.worker/bilibiliFeedSpace.worker.ts index 2c147e30..154d75cc 100644 --- a/packages/qqtools/src/QQ/function/expand/bilibili/feedSpace/bilibiliFeedSpace.worker/bilibiliFeedSpace.worker.ts +++ b/packages/qqtools/src/QQ/function/expand/bilibili/feedSpace/bilibiliFeedSpace.worker/bilibiliFeedSpace.worker.ts @@ -6,7 +6,7 @@ import * as CQ from '../../../../parser/CQ'; import type { QQProtocol } from '../../../../../QQBotModals/ModalTypes'; let bilibiliFeedSpaceId: string; // bilibili空间id -let bilibiliFeedSpaceTimer: NodeJS.Timer | null = null; +let bilibiliFeedSpaceTimer: NodeJS.Timeout | null = null; let latestTime: number | null = null; // 记录最新的时间 let protocol: QQProtocol; // 协议 let requestCookie: string; // 请求cookie diff --git a/packages/qqtools/src/QQ/function/expand/douyin/douyin.worker/douyin.worker.ts b/packages/qqtools/src/QQ/function/expand/douyin/douyin.worker/douyin.worker.ts index 75cb1fc8..e6549cf5 100644 --- a/packages/qqtools/src/QQ/function/expand/douyin/douyin.worker/douyin.worker.ts +++ b/packages/qqtools/src/QQ/function/expand/douyin/douyin.worker/douyin.worker.ts @@ -13,7 +13,7 @@ let userId: string; // 用户userId let description: string; // 描述 let protocol: QQProtocol; // 协议:mirai或者oicq let lastUpdateTime: number | 0 | null = null; // 记录最新发布视频的更新时间,为0表示当前没有数据,null表示请求数据失败了 -let douyinTimer: NodeJS.Timer | undefined = undefined; // 轮询定时器 +let douyinTimer: NodeJS.Timeout | undefined = undefined; // 轮询定时器 let cookieString: string | undefined = undefined; let intervalTime: number = 10 * 60 * 1_000; // 轮询间隔 diff --git a/packages/qqtools/src/QQ/function/expand/xiaohongshu/xiaohongshu.worker/xiaohongshu.worker.ts b/packages/qqtools/src/QQ/function/expand/xiaohongshu/xiaohongshu.worker/xiaohongshu.worker.ts index 6d237bc1..28e554c9 100644 --- a/packages/qqtools/src/QQ/function/expand/xiaohongshu/xiaohongshu.worker/xiaohongshu.worker.ts +++ b/packages/qqtools/src/QQ/function/expand/xiaohongshu/xiaohongshu.worker/xiaohongshu.worker.ts @@ -34,7 +34,7 @@ let protocol: QQProtocol; // 协议 let signProtocol: XHSProtocol; let lastUpdateTime: number | 0 | null = null; // 记录最新发布的更新时间,为0表示当前没有数据,null表示请求数据失败了 const intervalTime: number = 5 * 60 * 1_000; // 轮询间隔 -let xiaohongshuTimer: NodeJS.Timer | undefined = undefined; // 轮询定时器 +let xiaohongshuTimer: NodeJS.Timeout | undefined = undefined; // 轮询定时器 /* 调试 */ const _startTime: string = dayjs().format('YYYY-MM-DD HH:mm:ss'); diff --git a/packages/qqtools/src/pages/Options/EditV2/components/IMLogin/Pocket48Login/function/SMSStore.ts b/packages/qqtools/src/pages/Options/EditV2/components/IMLogin/Pocket48Login/function/SMSStore.ts index b8b105d1..170bd364 100644 --- a/packages/qqtools/src/pages/Options/EditV2/components/IMLogin/Pocket48Login/function/SMSStore.ts +++ b/packages/qqtools/src/pages/Options/EditV2/components/IMLogin/Pocket48Login/function/SMSStore.ts @@ -5,7 +5,7 @@ type Listener = () => void; /* 发送短信倒计时 */ class SMSStore { time: number = 0; - timer: NodeJS.Timer | number | null = null; + timer: NodeJS.Timeout | number | null = null; listeners: Array = []; getSnapshot: () => number = (): number => { diff --git a/packages/qqtools/src/services/48/jsdelivrCDN/index.ts b/packages/qqtools/src/services/48/jsdelivrCDN/index.ts index 91b030d7..d8d8de8a 100644 --- a/packages/qqtools/src/services/48/jsdelivrCDN/index.ts +++ b/packages/qqtools/src/services/48/jsdelivrCDN/index.ts @@ -6,7 +6,7 @@ export type * from './interface'; /* 查找roomid */ export async function requestRoomId(): Promise { const controller: AbortController = new AbortController(); - const timer: NodeJS.Timer = setTimeout((): void => { + const timer: NodeJS.Timeout = setTimeout((): void => { controller.abort(); }, 10_000); const res: Response = await fetch( From 24ca495487ed4e5fd5d0842809474f84ca528d7a Mon Sep 17 00:00:00 2001 From: duan602728596 Date: Wed, 23 Aug 2023 14:36:55 +0800 Subject: [PATCH 2/4] =?UTF-8?q?ci:=20=E4=BF=AE=E6=94=B9eslint=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 4dba5ee9..b74058be 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -294,7 +294,7 @@ module.exports = { 'error', { commonjs: true, - ignore: ['^worker-loader!', '^@qqtools-api/'] + ignore: ['^worker-loader!', '^@qqtools-api/', '^@qqtools-types/'] } ] } From e0aff439b5dd6eb70a6449ba464a567bcc107687 Mon Sep 17 00:00:00 2001 From: duan602728596 Date: Wed, 23 Aug 2023 16:06:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/NIMTest/node/roomId.json | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/packages/NIMTest/node/roomId.json b/packages/NIMTest/node/roomId.json index 67fc1e32..9f6adfcc 100644 --- a/packages/NIMTest/node/roomId.json +++ b/packages/NIMTest/node/roomId.json @@ -941,6 +941,18 @@ "pinyin": "sun yushan", "liveRoomId": 4311573 }, + { + "ownerName": "杨晔", + "id": 407126, + "serverId": 6227955, + "channelId": 7587624, + "account": "20190415141708_jkyh2158qu3n658", + "team": "TEAM X", + "teamId": 1004, + "groupName": "SNH48", + "periodName": "BEJ48 一期生", + "pinyin": "yang ye" + }, { "id": 407127, "roomId": "67380550", @@ -1627,6 +1639,18 @@ "ownerName": "CKG48-吴晶晶", "liveRoomId": 19843743 }, + { + "ownerName": "程戈", + "id": 618319, + "serverId": 8111741, + "channelId": 10191872, + "account": "20190415142725_mak792pzjhv3v5x", + "team": "IDFT", + "teamId": 1501, + "groupName": "IDFT", + "periodName": "SHY48 三期生", + "pinyin": "cheng ge" + }, { "id": 624121, "roomId": "67390999", @@ -3844,5 +3868,5 @@ "liveRoomId": 187874323 } ], - "buildTime": "2023-06-19 22:07:00" + "buildTime": "2023-08-23 16:04:51" } \ No newline at end of file From 8486fdaa4174798270d7c11b636d7c7b58c86170 Mon Sep 17 00:00:00 2001 From: duan602728596 Date: Wed, 23 Aug 2023 16:08:23 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E5=87=BD=E6=95=B0=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=9C=A8window?= =?UTF-8?q?=E4=B8=8B=E5=8A=A0=E8=BD=BD=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/NIMTest/node/createRoomId.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/NIMTest/node/createRoomId.js b/packages/NIMTest/node/createRoomId.js index a815ae6a..d954620c 100644 --- a/packages/NIMTest/node/createRoomId.js +++ b/packages/NIMTest/node/createRoomId.js @@ -3,6 +3,7 @@ const path = require('node:path'); const { randomUUID } = require('node:crypto'); const _ = require('lodash'); const dayjs = require('dayjs'); +const importESM = require('@sweet-milktea/utils/importESM'); require('dayjs/locale/zh-cn'); require('../../NIMNodePolyfill/NIMNodePolyfill.cjs'); @@ -45,7 +46,7 @@ function headers() { // 获取房间信息 function getRoomInfo(chatroomId) { return new Promise(async (resolve, reject) => { - const appKey = await import(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs')); + const appKey = await importESM(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs')); const nimChatroomSocket = Chatroom.getInstance({ appKey: atob(appKey.default), isAnonymous: true, @@ -78,7 +79,7 @@ function getRoomInfo(chatroomId) { function getServerInfo(serverId) { return new Promise(async (resolve, reject) => { try { - const appKey = await import(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs')); + const appKey = await importESM(path.join(__dirname, '../../qqtools/src/QQ/sdk/appKey.mjs')); const qchat = new QChatSDK({ appkey: atob(appKey.default), account: pocket48Account,