perf: 删除 QQ 扫码登录相关代码

This commit is contained in:
Clansty 2023-11-08 16:35:33 +08:00
parent 4987b15e0e
commit a087582979
No known key found for this signature in database
4 changed files with 1 additions and 28 deletions

View File

@ -36,8 +36,6 @@ interface CreateOicqParams {
onVerifyDevice: (phone: string) => Promise<string>;
// 当滑块时调用此方法,返回 ticker也可以返回假值改用扫码登录
onVerifySlider: (url: string) => Promise<string>;
// 扫码后返回
onQrCode: (image: Buffer) => Promise<void>;
}
// OicqExtended??
@ -78,11 +76,6 @@ export default class OicqClient extends Client {
}
};
const loginQrCodeHandler = async ({ image }: { image: Buffer }) => {
await params.onQrCode(image);
client.qrcodeLogin();
};
const loginErrorHandler = ({ message }: { code: number; message: string }) => {
reject(message);
};
@ -90,7 +83,6 @@ export default class OicqClient extends Client {
const successLoginHandler = () => {
client.offTrap('system.login.device', loginDeviceHandler);
client.offTrap('system.login.slider', loginSliderHandler);
client.offTrap('system.login.qrcode', loginQrCodeHandler);
client.offTrap('system.login.error', loginErrorHandler);
client.offTrap('system.online', successLoginHandler);
@ -136,7 +128,6 @@ export default class OicqClient extends Client {
});
client.on('system.login.device', loginDeviceHandler);
client.on('system.login.slider', loginSliderHandler);
client.on('system.login.qrcode', loginQrCodeHandler);
client.on('system.login.error', loginErrorHandler);
client.on('system.online', successLoginHandler);

View File

@ -80,8 +80,6 @@ export default class SetupController {
platform: this.instance.qq.platform,
signApi: this.instance.qq.signApi,
signVer: this.instance.qq.signVer,
onQrCode: async (file) => {
},
onVerifyDevice: async (phone) => {
return await this.setupService.waitForOwnerInput(`请输入手机 ${phone} 收到的验证码`);
},

View File

@ -123,14 +123,6 @@ export default class Instance {
platform: this.qq.platform,
signApi: this.qq.signApi,
signVer: this.qq.signVer,
onQrCode: async (file) => {
await this.ownerChat.sendMessage({
message: '请使用已登录这个账号的手机 QQ 扫描这个二维码授权',
file: new CustomFile('qrcode.png', file.length, '', file),
buttons: Button.text('我已扫码', true, true),
});
await this.waitForOwnerInput();
},
onVerifyDevice: async (phone) => {
return await this.waitForOwnerInput(`请输入手机 ${phone} 收到的验证码`);
},

View File

@ -87,15 +87,7 @@ export default class SetupService {
const dbQQBot = await db.qqBot.create({ data: { uin, password, platform, signApi, signVer } });
return await OicqClient.create({
id: dbQQBot.id,
uin, password, platform, signApi, signVer,
onQrCode: async (file) => {
await this.owner.sendMessage({
message: '请使用已登录这个账号的手机 QQ 扫描这个二维码授权',
file: new CustomFile('qrcode.png', file.length, '', file),
buttons: Button.text('我已扫码', true, true),
});
await this.waitForOwnerInput();
},
uin, password, platform, signApi, signVer,
onVerifyDevice: async (phone) => {
return await this.waitForOwnerInput(`请输入手机 ${phone} 收到的验证码`);
},