From 5681dc3581d8b4c457dda79448375990fa40f975 Mon Sep 17 00:00:00 2001 From: Clansty Date: Thu, 28 Dec 2023 16:16:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=87=AA=E5=8A=A8=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E7=AD=BE=E5=90=8D=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yaml | 2 -- prisma/schema.prisma | 1 - src/client/OicqClient.ts | 2 -- src/controllers/SetupController.ts | 15 +-------------- src/models/Instance.ts | 1 - src/services/SetupService.ts | 6 +++--- 6 files changed, 4 insertions(+), 23 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index ed3ce014..ed097456 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -32,7 +32,6 @@ services: image: xzhouqd/qsign:core-1.1.9 restart: unless-stopped environment: - # 需要与下方的 SIGN_VER 同步 # 配置请参考 https://hub.docker.com/r/xzhouqd/qsign - BASE_PATH=/srv/qsign/qsign/txlib/8.9.71 q2tg: @@ -55,7 +54,6 @@ services: - ZINC_USERNAME=admin - ZINC_PASSWORD=password - SIGN_API=http://sign:8080/sign?key=114514 - - SIGN_VER=8.9.71 # 与上方 sign 容器的配置同步 - TG_CONNECTION=tcp # 连接 Telegram 的方式,也可以改成 websocket # 要支持转发时自动识别语音,请设置以下参数 - BAIDU_APP_ID= diff --git a/prisma/schema.prisma b/prisma/schema.prisma index a75fb0be..dfa9f759 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -54,7 +54,6 @@ model QqBot { platform Int @default(0) Instance Instance[] signApi String? - signVer String? } model Message { diff --git a/src/client/OicqClient.ts b/src/client/OicqClient.ts index b540359f..b27135db 100644 --- a/src/client/OicqClient.ts +++ b/src/client/OicqClient.ts @@ -31,7 +31,6 @@ interface CreateOicqParams { password: string; platform: Platform; signApi?: string; - signVer?: string; // 当需要验证手机时调用此方法,应该返回收到的手机验证码 onVerifyDevice: (phone: string) => Promise; // 当滑块时调用此方法,返回 ticker,也可以返回假值改用扫码登录 @@ -124,7 +123,6 @@ export default class OicqClient extends Client { ffmpeg_path: process.env.FFMPEG_PATH, ffprobe_path: process.env.FFPROBE_PATH, 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); diff --git a/src/controllers/SetupController.ts b/src/controllers/SetupController.ts index fb8fe7f8..a31e8917 100644 --- a/src/controllers/SetupController.ts +++ b/src/controllers/SetupController.ts @@ -79,7 +79,6 @@ export default class SetupController { password: this.instance.qq.password, platform: this.instance.qq.platform, signApi: this.instance.qq.signApi, - signVer: this.instance.qq.signVer, onVerifyDevice: async (phone) => { return await this.setupService.waitForOwnerInput(`请输入手机 ${phone} 收到的验证码`); }, @@ -112,21 +111,9 @@ export default class SetupController { signApi = setupHelper.checkSignApiAddress(signApi); } - let signVer: string; - - if (signApi && !process.env.SIGN_VER) { - signVer = await this.setupService.waitForOwnerInput('请输入签名服务器版本,当前支持安卓(8.9.63、8.9.68、8.9.70)、Tim(3.5.1、3.5.2)', [ - [Button.text('8.9.63', true, true)], - [Button.text('8.9.68', true, true)], - [Button.text('8.9.70', true, true)], - [Button.text('3.5.1', true, true)], - [Button.text('3.5.2', true, true)], - ]); - } - let password = await this.setupService.waitForOwnerInput('请输入密码', undefined, true); password = md5Hex(password); - this.oicq = await this.setupService.createOicq(uin, password, platform, signApi, signVer); + this.oicq = await this.setupService.createOicq(uin, password, platform, signApi); this.instance.qqBotId = this.oicq.id; await this.setupService.informOwner(`登录成功`); } diff --git a/src/models/Instance.ts b/src/models/Instance.ts index 91b7fc30..fc71266b 100644 --- a/src/models/Instance.ts +++ b/src/models/Instance.ts @@ -122,7 +122,6 @@ export default class Instance { password: this.qq.password, platform: this.qq.platform, signApi: this.qq.signApi, - signVer: this.qq.signVer, onVerifyDevice: async (phone) => { return await this.waitForOwnerInput(`请输入手机 ${phone} 收到的验证码`); }, diff --git a/src/services/SetupService.ts b/src/services/SetupService.ts index 0213180d..e5033d26 100644 --- a/src/services/SetupService.ts +++ b/src/services/SetupService.ts @@ -83,11 +83,11 @@ export default class SetupService { }); } - public async createOicq(uin: number, password: string, platform: Platform, signApi: string, signVer: string) { - const dbQQBot = await db.qqBot.create({ data: { uin, password, platform, signApi, signVer } }); + public async createOicq(uin: number, password: string, platform: Platform, signApi: string) { + const dbQQBot = await db.qqBot.create({ data: { uin, password, platform, signApi } }); return await OicqClient.create({ id: dbQQBot.id, - uin, password, platform, signApi, signVer, + uin, password, platform, signApi, onVerifyDevice: async (phone) => { return await this.waitForOwnerInput(`请输入手机 ${phone} 收到的验证码`); },