fix: body too large

This commit is contained in:
linyuchen 2023-12-03 15:52:14 +08:00
parent 0c131ff555
commit bffa2d9a31
2 changed files with 8 additions and 3 deletions

View File

@ -4,7 +4,7 @@
"name": "LLOneBot",
"slug": "LLOneBot",
"description": "LiteLoaderQQNT的OneBotApi",
"version": "1.2.1",
"version": "1.2.2",
"thumbnail": "./icon.png",
"author": {
"name": "linyuchen",

View File

@ -1,11 +1,15 @@
import {sendIPCRecallQQMsg, sendIPCSendQQMsg} from "./IPCSend";
const express = require("express");
const bodyParser = require('body-parser');
import {OnebotGroupMemberRole, PostDataAction, PostDataSendMsg} from "../common/types";
import {friends, groups, selfInfo} from "./data";
function handlePost(jsonData: any) {
jsonData.params = jsonData;
if (!jsonData.params) {
jsonData.params = jsonData
}
let resData = {
status: 0,
retcode: 0,
@ -93,7 +97,8 @@ function handlePost(jsonData: any) {
export function startExpress(port: number) {
const app = express();
// 中间件用于解析POST请求的请求体
app.use(express.urlencoded({extended: true}));
app.use(express.urlencoded({extended: true, limit: "50mb"}));
app.use(bodyParser({limit: '50mb'}))
app.use(express.json());
function parseToOnebot12(action: PostDataAction) {