Skip to content

Commit

Permalink
fix: 修复参数没有传进去的 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Nov 5, 2023
1 parent 412532a commit 37099d3
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 28 deletions.
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.18.2
2 changes: 0 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ services:
# 如果有现成的 Postgresql 实例,可以删除这一小节
postgres:
image: postgres:14-alpine
container_name: postgresql_q2tg
restart: unless-stopped
environment:
POSTGRES_DB: db_name
Expand Down Expand Up @@ -38,7 +37,6 @@ services:
- BASE_PATH=/srv/qsign/qsign/txlib/8.9.71
q2tg:
image: ghcr.io/clansty/q2tg:rainbowcat
container_name: main_q2tg
restart: unless-stopped
depends_on:
- postgres
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@types/node": "^18.6.3",
"@types/prompts": "^2.0.14",
"@types/sharp": "^0.31.1",
"prisma": "4.6.0",
"ts-node": "^10.9.1",
"tsc": "^2.0.4",
"typescript": "^4.7.4"
Expand Down
10 changes: 5 additions & 5 deletions src/client/OicqClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { randomBytes } from 'crypto';
import { escapeXml, gzip, timestamp } from 'icqq/lib/common';
import { pb } from 'icqq/lib/core';

const LOG_LEVEL: LogLevel = 'info';
const LOG_LEVEL: LogLevel = process.env.LOG_LEVEL as LogLevel || 'info';

type MessageHandler = (event: PrivateMessageEvent | GroupMessageEvent) => Promise<boolean | void>

Expand Down Expand Up @@ -97,8 +97,8 @@ export default class OicqClient extends Client {
if (!client.isOnMessageCreated) {
client.trap('message', client.onMessage);
client.isOnMessageCreated = true;
};
}

resolve(client);
};

Expand Down Expand Up @@ -131,8 +131,8 @@ export default class OicqClient extends Client {
log_level: LOG_LEVEL,
ffmpeg_path: process.env.FFMPEG_PATH,
ffprobe_path: process.env.FFPROBE_PATH,
sign_api_addr: params.signApi,
ver: params.signVer,
sign_api_addr: params.signApi || process.env.SIGN_API,
ver: params.signVer || process.env.SIGN_VER,
});
client.on('system.login.device', loginDeviceHandler);
client.on('system.login.slider', loginSliderHandler);
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import db from './models/db';
}

setTimeout(async () => {
log.info('开始加载 MapInstance')
log.info('开始加载 MapInstance');
for (const instance of instances.filter(it => it.workMode === 'group')) {
await instance.forwardPairs.initMapInstance(instances.filter(it => it.workMode === 'personal'));
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/Instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export default class Instance {
uin: Number(this.qq.uin),
password: this.qq.password,
platform: this.qq.platform,
signApi: this.qq.signApi || process.env.SIGN_API,
signVer: this.qq.signVer || process.env.SIGN_VER,
signApi: this.qq.signApi,
signVer: this.qq.signVer,
onQrCode: async (file) => {
await this.ownerChat.sendMessage({
message: '请使用已登录这个账号的手机 QQ 扫描这个二维码授权',
Expand Down
38 changes: 20 additions & 18 deletions yarn-project.nix

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,13 @@ __metadata:
languageName: node
linkType: hard

"@prisma/engines@npm:4.6.0":
version: 4.6.0
resolution: "@prisma/engines@npm:4.6.0"
checksum: d964ab9641153410d1e4b5c81dfb4be309964b133eb891140cf8636a7e8bfd33228f92b83a3b700b1b97eaa0b58aa5ad113836e8d76ff3cc901b500938736214
languageName: node
linkType: hard

"@tokenizer/token@npm:^0.3.0":
version: 0.3.0
resolution: "@tokenizer/token@npm:0.3.0"
Expand Down Expand Up @@ -3603,6 +3610,18 @@ __metadata:
languageName: node
linkType: hard

"prisma@npm:4.6.0":
version: 4.6.0
resolution: "prisma@npm:4.6.0"
dependencies:
"@prisma/engines": 4.6.0
bin:
prisma: build/index.js
prisma2: build/index.js
checksum: eee15955638c67dcdff8d0338a1cad5f4b3fc62f6894336543d6f3d09456295f5e23916f7bedbb396a5ca5d7be5fa62dc52d49e95f971ad3968e6d650d9934ea
languageName: node
linkType: hard

"probe-image-size@npm:^7.2.2":
version: 7.2.3
resolution: "probe-image-size@npm:7.2.3"
Expand Down Expand Up @@ -3711,6 +3730,7 @@ __metadata:
lodash: ^4.17.21
log4js: ^6.6.1
nodejs-base64: ^2.0.0
prisma: 4.6.0
prompts: ^2.4.2
quote-api: "https://github.com/Clansty/quote-api/archive/7d9b4c56ab1e9f3cdf1cd7e108ec25821d89ad70.tar.gz"
sharp: ^0.31.3
Expand Down

0 comments on commit 37099d3

Please sign in to comment.