Compare commits

..

7 Commits

Author SHA1 Message Date
手瓜一十雪
feb84809ec fix: #761 2025-02-04 21:22:36 +08:00
bietiaop
a812c568e4 fix: 文件预览 2025-02-04 21:12:13 +08:00
bietiaop
11db25e355 fix: 文件预览 2025-02-04 21:08:28 +08:00
手瓜一十雪
ecd2fba629 fix: #762 2025-02-04 20:42:13 +08:00
Mlikiowa
a6763cf5a1 release: v4.5.5 2025-02-04 11:50:37 +00:00
手瓜一十雪
c9e91a9b94 fix: defalut config 2025-02-04 19:49:56 +08:00
Mlikiowa
43fb62c5bd release: v4.5.4 2025-02-04 11:35:51 +00:00
8 changed files with 21 additions and 15 deletions

View File

@@ -4,7 +4,7 @@
"name": "NapCatQQ", "name": "NapCatQQ",
"slug": "NapCat.Framework", "slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现", "description": "高性能的 OneBot 11 协议实现",
"version": "4.5.3", "version": "4.5.5",
"icon": "./logo.png", "icon": "./logo.png",
"authors": [ "authors": [
{ {

View File

@@ -45,6 +45,12 @@ export default function FilePreviewModal({
} }
) )
useEffect(() => {
if (filePath) {
run()
}
}, [filePath])
let contentElement = null let contentElement = null
if (!supportedPreviewExts.includes(ext)) { if (!supportedPreviewExts.includes(ext)) {
contentElement = <div></div> contentElement = <div></div>
@@ -68,12 +74,6 @@ export default function FilePreviewModal({
) )
} }
useEffect(() => {
if (filePath) {
run()
}
}, [])
return ( return (
<Modal isOpen={isOpen} onClose={onClose} scrollBehavior="inside" size="3xl"> <Modal isOpen={isOpen} onClose={onClose} scrollBehavior="inside" size="3xl">
<ModalContent> <ModalContent>

View File

@@ -58,6 +58,7 @@ export default function ImageNameButton({
run() run()
} }
}, []) }, [])
return ( return (
<Button <Button
variant="light" variant="light"
@@ -69,7 +70,12 @@ export default function ImageNameButton({
) : loading || !data ? ( ) : loading || !data ? (
<Spinner size="sm" /> <Spinner size="sm" />
) : ( ) : (
<Image src={data} alt={name} className="w-8 h-8" radius="sm" /> <Image
src={data}
alt={name}
className="w-8 h-8 flex-shrink-0"
radius="sm"
/>
) )
} }
> >

View File

@@ -20,7 +20,7 @@ const WebsocketServerForm: React.FC<WebsocketServerFormProps> = ({
enable: false, enable: false,
name: '', name: '',
host: '0.0.0.0', host: '0.0.0.0',
port: 3000, port: 3001,
reportSelfMessage: false, reportSelfMessage: false,
enableForcePushEvent: true, enableForcePushEvent: true,
messagePostFormat: 'array', messagePostFormat: 'array',

View File

@@ -2,7 +2,7 @@
"name": "napcat", "name": "napcat",
"private": true, "private": true,
"type": "module", "type": "module",
"version": "4.5.3", "version": "4.5.5",
"scripts": { "scripts": {
"build:universal": "npm run build:webui && vite build --mode universal || exit 1", "build:universal": "npm run build:webui && vite build --mode universal || exit 1",
"build:framework": "npm run build:webui && vite build --mode framework || exit 1", "build:framework": "npm run build:webui && vite build --mode framework || exit 1",

View File

@@ -1 +1 @@
export const napCatVersion = '4.5.3'; export const napCatVersion = '4.5.5';

View File

@@ -1,4 +1,4 @@
import { OB11EmitEventContent, OB11NetworkReloadType } from './index'; import { OB11EmitEventContent, OB11NetworkReloadType } from './index';
import express, { Express, NextFunction, Request, Response } from 'express'; import express, { Express, NextFunction, Request, Response } from 'express';
import http from 'http'; import http from 'http';
import { NapCatCore } from '@/core'; import { NapCatCore } from '@/core';
@@ -60,7 +60,7 @@ export class OB11HttpServerAdapter extends IOB11NetworkAdapter<HttpServerConfig>
}); });
req.on('end', () => { req.on('end', () => {
try { try {
req.body = json5.parse(rawData || '{}'); req.body = { ...json5.parse(rawData || '{}'), ...req.body };
next(); next();
} catch { } catch {
return res.status(400).send('Invalid JSON'); return res.status(400).send('Invalid JSON');

View File

@@ -7,8 +7,8 @@ export const GetProxyHandler: RequestHandler = async (req, res) => {
if (url && typeof url === 'string') { if (url && typeof url === 'string') {
url = decodeURIComponent(url); url = decodeURIComponent(url);
const responseText = await RequestUtil.HttpGetText(url); const responseText = await RequestUtil.HttpGetText(url);
res.send(sendSuccess(res, responseText)); return sendSuccess(res, responseText);
} else { } else {
res.send(sendError(res, 'url参数不合法')); return sendError(res, 'url参数不合法');
} }
}; };