This commit is contained in:
手瓜一十雪 2024-11-14 13:07:10 +08:00
parent abfda0dd58
commit c747a86e5b
8 changed files with 7 additions and 9 deletions

View File

@ -7,12 +7,12 @@ export const int32ip2str = (ip: number) => {
return [ip & 0xff, (ip & 0xff00) >> 8, (ip & 0xff0000) >> 16, ((ip & 0xff000000) >> 24) & 0xff].join('.'); return [ip & 0xff, (ip & 0xff00) >> 8, (ip & 0xff0000) >> 16, ((ip & 0xff000000) >> 24) & 0xff].join('.');
}; };
export const oidbIpv4s2HighwayIpv4s = (ipv4s: NapProtoEncodeStructType<typeof proto.IPv4>[]): NapProtoEncodeStructType<typeof proto.NTHighwayIPv4>[] =>{ export const oidbIpv4s2HighwayIpv4s = (ipv4s: NapProtoEncodeStructType<typeof proto.IPv4>[]): NapProtoEncodeStructType<typeof proto.NTHighwayIPv4>[] => {
return ipv4s.map((ip) => { return ipv4s.map((ip) => {
return { return {
domain: { domain: {
isEnable: true, isEnable: true,
ip: int32ip2str(ip.outIP!), ip: int32ip2str(ip.outIP ?? 0),
}, },
port: ip.outPort! port: ip.outPort!
} as NapProtoEncodeStructType<typeof proto.NTHighwayIPv4>; } as NapProtoEncodeStructType<typeof proto.NTHighwayIPv4>;

View File

@ -82,7 +82,7 @@ export class PacketMsgConverter {
return SupportedElementTypes.includes(type); return SupportedElementTypes.includes(type);
} }
private rawToPacketMsgConverters: ElementToPacketMsgConverters = { private readonly rawToPacketMsgConverters: ElementToPacketMsgConverters = {
[ElementType.TEXT]: (element) => { [ElementType.TEXT]: (element) => {
if (element.textElement?.atType) { if (element.textElement?.atType) {
return new PacketMsgAtElement(element as SendTextElement); return new PacketMsgAtElement(element as SendTextElement);

View File

@ -3,7 +3,6 @@ import { OB11Entities } from '@/onebot/entities';
import BaseAction from '../BaseAction'; import BaseAction from '../BaseAction';
import { ActionName } from '../types'; import { ActionName } from '../types';
import { FromSchema, JSONSchema } from 'json-schema-to-ts'; import { FromSchema, JSONSchema } from 'json-schema-to-ts';
import { GroupMember } from '@/core';
const SchemaData = { const SchemaData = {
type: 'object', type: 'object',

View File

@ -18,7 +18,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
public url: string, public url: string,
public reconnectIntervalInMillis: number, public reconnectIntervalInMillis: number,
public heartbeatIntervalInMillis: number, public heartbeatIntervalInMillis: number,
private token: string, private readonly token: string,
public core: NapCatCore, public core: NapCatCore,
public actions: ActionMap, public actions: ActionMap,
) { ) {

View File

@ -255,7 +255,7 @@ export async function NCoreInitShell() {
// from initSession // from initSession
const sessionConfig = await genSessionConfig( const sessionConfig = await genSessionConfig(
guid, guid,
basicInfoWrapper.QQVersionAppid!, basicInfoWrapper.QQVersionAppid,
basicInfoWrapper.getFullQQVesion(), basicInfoWrapper.getFullQQVesion(),
selfInfo.uin, selfInfo.uin,
selfInfo.uid, selfInfo.uid,

View File

@ -11,7 +11,7 @@ interface WebUiCredentialJson {
} }
export class AuthHelper { export class AuthHelper {
private static secretKey = Math.random().toString(36).slice(2); private static readonly secretKey = Math.random().toString(36).slice(2);
/** /**
* *

View File

@ -114,7 +114,7 @@ export class WebUiConfigWrapper {
// 不希望回写的配置放后面 // 不希望回写的配置放后面
// 查询主机地址是否可用 // 查询主机地址是否可用
const [host_err, host] = await tryUseHost(parsedConfig.host).then(data => [null, data as string]).catch(err => [err, null]); const [host_err, host] = await tryUseHost(parsedConfig.host).then(data => [null, data]).catch(err => [err, null]);
if (host_err) { if (host_err) {
console.log('host不可用', host_err); console.log('host不可用', host_err);
parsedConfig.port = 0; // 设置为0禁用WebUI parsedConfig.port = 0; // 设置为0禁用WebUI

View File

@ -78,7 +78,6 @@
return; return;
} }
window.location.href = './login.html'; window.location.href = './login.html';
return;
} }
InitPage(); InitPage();
</script> </script>