mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: ws token not work
This commit is contained in:
parent
ddcbe78a01
commit
ecb4e7bf9f
@ -148,7 +148,6 @@ export async function createSendElements(messageData: OB11MessageData[], group:
|
|||||||
let file = sendMsg.data?.file;
|
let file = sendMsg.data?.file;
|
||||||
const payloadFileName = sendMsg.data?.name;
|
const payloadFileName = sendMsg.data?.name;
|
||||||
if (file) {
|
if (file) {
|
||||||
// todo: 使用缓存文件发送
|
|
||||||
const cache = await dbUtil.getFileCacheByName(file);
|
const cache = await dbUtil.getFileCacheByName(file);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
if (fs.existsSync(cache.path)) {
|
if (fs.existsSync(cache.path)) {
|
||||||
|
@ -17,6 +17,12 @@ import { selfInfo } from '@/common/data';
|
|||||||
const heartbeatRunning = false;
|
const heartbeatRunning = false;
|
||||||
|
|
||||||
class OB11WebsocketServer extends WebsocketServerBase {
|
class OB11WebsocketServer extends WebsocketServerBase {
|
||||||
|
|
||||||
|
public start(port: number) {
|
||||||
|
this.token = ob11Config.token;
|
||||||
|
super.start(port);
|
||||||
|
}
|
||||||
|
|
||||||
authorizeFailed(wsClient: WebSocket) {
|
authorizeFailed(wsClient: WebSocket) {
|
||||||
wsClient.send(JSON.stringify(OB11Response.res(null, 'failed', 1403, 'token验证失败')));
|
wsClient.send(JSON.stringify(OB11Response.res(null, 'failed', 1403, 'token验证失败')));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user