mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
fix: body too large
This commit is contained in:
parent
0c131ff555
commit
bffa2d9a31
@ -4,7 +4,7 @@
|
|||||||
"name": "LLOneBot",
|
"name": "LLOneBot",
|
||||||
"slug": "LLOneBot",
|
"slug": "LLOneBot",
|
||||||
"description": "LiteLoaderQQNT的OneBotApi",
|
"description": "LiteLoaderQQNT的OneBotApi",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"thumbnail": "./icon.png",
|
"thumbnail": "./icon.png",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "linyuchen",
|
"name": "linyuchen",
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
import {sendIPCRecallQQMsg, sendIPCSendQQMsg} from "./IPCSend";
|
import {sendIPCRecallQQMsg, sendIPCSendQQMsg} from "./IPCSend";
|
||||||
|
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
|
const bodyParser = require('body-parser');
|
||||||
import {OnebotGroupMemberRole, PostDataAction, PostDataSendMsg} from "../common/types";
|
import {OnebotGroupMemberRole, PostDataAction, PostDataSendMsg} from "../common/types";
|
||||||
import {friends, groups, selfInfo} from "./data";
|
import {friends, groups, selfInfo} from "./data";
|
||||||
|
|
||||||
function handlePost(jsonData: any) {
|
function handlePost(jsonData: any) {
|
||||||
jsonData.params = jsonData;
|
if (!jsonData.params) {
|
||||||
|
jsonData.params = jsonData
|
||||||
|
|
||||||
|
}
|
||||||
let resData = {
|
let resData = {
|
||||||
status: 0,
|
status: 0,
|
||||||
retcode: 0,
|
retcode: 0,
|
||||||
@ -93,7 +97,8 @@ function handlePost(jsonData: any) {
|
|||||||
export function startExpress(port: number) {
|
export function startExpress(port: number) {
|
||||||
const app = express();
|
const app = express();
|
||||||
// 中间件,用于解析POST请求的请求体
|
// 中间件,用于解析POST请求的请求体
|
||||||
app.use(express.urlencoded({extended: true}));
|
app.use(express.urlencoded({extended: true, limit: "50mb"}));
|
||||||
|
app.use(bodyParser({limit: '50mb'}))
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
function parseToOnebot12(action: PostDataAction) {
|
function parseToOnebot12(action: PostDataAction) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user