chore: 移除无用代码

This commit is contained in:
手瓜一十雪 2024-08-07 09:39:23 +08:00
parent b3c1eff137
commit 4b6cde786e
4 changed files with 10 additions and 32 deletions

4
src/nwebui/Readme.md Normal file
View File

@ -0,0 +1,4 @@
# NewWebui
基于Vue3实现的现代化轻量化NapCat管理面板
## 进度
画饼

View File

@ -1,20 +0,0 @@
import BaseAction from '../BaseAction';
import { OB11Config, ob11Config } from '@/onebot11/config';
import { ActionName } from '../types';
export class GetConfigAction extends BaseAction<null, OB11Config> {
actionName = ActionName.GetConfig;
protected async _handle(payload: null): Promise<OB11Config> {
return ob11Config;
}
}
export class SetConfigAction extends BaseAction<OB11Config, void> {
actionName = ActionName.SetConfig;
protected async _handle(payload: OB11Config): Promise<void> {
ob11Config.save(payload, true);
}
}

View File

@ -24,12 +24,12 @@ export class GoCQHTTPGetForwardMsgAction extends BaseAction<Payload, any> {
actionName = ActionName.GoCQHTTP_GetForwardMsg;
PayloadSchema = SchemaData;
protected async _handle(payload: Payload): Promise<any> {
const msgId = payload.message_id || payload.id;
if (!msgId) {
throw Error('message_id is required');
const msgIdMixOb11Id = payload.message_id || payload.id;
if (!msgIdMixOb11Id) {
throw Error('message_id or id is required');
}
const rootMsgId = MessageUnique.getShortIdByMsgId(msgId);
const rootMsg = MessageUnique.getMsgIdAndPeerByShortId(rootMsgId || parseInt(msgId));
const rootMsgId = MessageUnique.getShortIdByMsgId(msgIdMixOb11Id);
const rootMsg = MessageUnique.getMsgIdAndPeerByShortId(rootMsgId || parseInt(msgIdMixOb11Id));
if (!rootMsg) {
throw Error('msg not found');
}

View File

@ -1,10 +1,4 @@
import fs from 'node:fs';
import path from 'node:path';
import { selfInfo } from '@/core/data';
import { logDebug, logError } from '@/common/utils/log';
import { ConfigBase } from '@/common/utils/ConfigBase';
import { json } from 'stream/consumers';
export interface OB11Config {
http: {
enable: boolean;
@ -36,7 +30,7 @@ export interface OB11Config {
Record: boolean,
RecordList: Array<string>
},
read(): OB11Config;
read(): OB11Config | null;
save(config: OB11Config): void;
}