mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-13 00:10:27 +00:00
Compare commits
8 Commits
copilot/fi
...
v4.8.118
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7f00c0594 | ||
|
|
77c8f874b6 | ||
|
|
fb0a20919b | ||
|
|
0300ba4648 | ||
|
|
d472eee777 | ||
|
|
41bd06e50a | ||
|
|
97334dfbf5 | ||
|
|
e3d8c8e940 |
@@ -7,7 +7,7 @@ set NAPCAT_LAUNCHER_PATH=%cd%\NapCatWinBootMain.exe
|
||||
set NAPCAT_MAIN_PATH=%cd%\napcat.mjs
|
||||
:loop_read
|
||||
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
||||
set RetString=%%b
|
||||
set "RetString=%%~b"
|
||||
goto :napcat_boot
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ for %%a in ("%RetString%") do (
|
||||
set "pathWithoutUninstall=%%~dpa"
|
||||
)
|
||||
|
||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||
set "QQPath=%pathWithoutUninstall%QQ.exe"
|
||||
|
||||
if not exist "%QQpath%" (
|
||||
echo provided QQ path is invalid
|
||||
|
||||
@@ -7,7 +7,7 @@ set NAPCAT_LAUNCHER_PATH=%cd%\NapCatWinBootMain.exe
|
||||
set NAPCAT_MAIN_PATH=%cd%\napcat.mjs
|
||||
:loop_read
|
||||
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
||||
set RetString=%%b
|
||||
set "RetString=%%~b"
|
||||
goto :napcat_boot
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ for %%a in ("%RetString%") do (
|
||||
set "pathWithoutUninstall=%%~dpa"
|
||||
)
|
||||
|
||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||
set "QQPath=%pathWithoutUninstall%QQ.exe"
|
||||
|
||||
if not exist "%QQpath%" (
|
||||
echo provided QQ path is invalid
|
||||
|
||||
@@ -16,7 +16,7 @@ set NAPCAT_LAUNCHER_PATH=%cd%\NapCatWinBootMain.exe
|
||||
set NAPCAT_MAIN_PATH=%cd%\napcat.mjs
|
||||
:loop_read
|
||||
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
||||
set RetString=%%b
|
||||
set "RetString=%%~b"
|
||||
goto :napcat_boot
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ for %%a in ("%RetString%") do (
|
||||
set "pathWithoutUninstall=%%~dpa"
|
||||
)
|
||||
|
||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||
set "QQPath=%pathWithoutUninstall%QQ.exe"
|
||||
|
||||
if not exist "%QQPath%" (
|
||||
echo provided QQ path is invalid
|
||||
|
||||
@@ -16,7 +16,7 @@ set NAPCAT_LAUNCHER_PATH=%cd%\NapCatWinBootMain.exe
|
||||
set NAPCAT_MAIN_PATH=%cd%\napcat.mjs
|
||||
:loop_read
|
||||
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
||||
set RetString=%%b
|
||||
set "RetString=%%~b"
|
||||
goto :napcat_boot
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ for %%a in ("%RetString%") do (
|
||||
set "pathWithoutUninstall=%%~dpa"
|
||||
)
|
||||
|
||||
SET QQPath=%pathWithoutUninstall%QQ.exe
|
||||
set "QQPath=%pathWithoutUninstall%QQ.exe"
|
||||
|
||||
if not exist "%QQPath%" (
|
||||
echo provided QQ path is invalid
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"name": "NapCatQQ",
|
||||
"slug": "NapCat.Framework",
|
||||
"description": "高性能的 OneBot 11 协议实现",
|
||||
"version": "4.8.116",
|
||||
"version": "4.8.117",
|
||||
"icon": "./logo.png",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
@@ -82,6 +82,7 @@ export default function FileTable({
|
||||
setPreviewImages([])
|
||||
setPreviewIndex(0)
|
||||
setShowImage(false)
|
||||
setPage(1)
|
||||
}, [currentPath])
|
||||
|
||||
const onPreviewImage = (name: string, images: PreviewImage[]) => {
|
||||
|
||||
@@ -171,7 +171,8 @@ const GenericForm = <T extends keyof NetworkConfigType>({
|
||||
|
||||
export default GenericForm
|
||||
export function random_token(length: number) {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()-_=+[]{}|;:,.<>?'
|
||||
const chars =
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()-_=+[]{}|;:,.<>?'
|
||||
let result = ''
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += chars.charAt(Math.floor(Math.random() * chars.length))
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import CryptoJS from 'crypto-js'
|
||||
import { EventSourcePolyfill } from 'event-source-polyfill'
|
||||
|
||||
import { LogLevel } from '@/const/enum'
|
||||
|
||||
import { serverRequest } from '@/utils/request'
|
||||
import CryptoJS from "crypto-js";
|
||||
|
||||
export interface Log {
|
||||
level: LogLevel
|
||||
message: string
|
||||
@@ -17,7 +18,7 @@ export default class WebUIManager {
|
||||
}
|
||||
|
||||
public static async loginWithToken(token: string) {
|
||||
const sha256 = CryptoJS.SHA256(token + '.napcat').toString();
|
||||
const sha256 = CryptoJS.SHA256(token + '.napcat').toString()
|
||||
const { data } = await serverRequest.post<ServerResponse<AuthResponse>>(
|
||||
'/auth/login',
|
||||
{ hash: sha256 }
|
||||
|
||||
@@ -182,4 +182,4 @@ const ServerConfigCard = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default ServerConfigCard
|
||||
export default ServerConfigCard
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "4.8.116",
|
||||
"version": "4.8.117",
|
||||
"scripts": {
|
||||
"build:universal": "npm run build:webui && vite build --mode universal || exit 1",
|
||||
"build:framework": "npm run build:webui && vite build --mode framework || exit 1",
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const napCatVersion = '4.8.116';
|
||||
export const napCatVersion = '4.8.117';
|
||||
|
||||
4
src/core/external/appid.json
vendored
4
src/core/external/appid.json
vendored
@@ -386,5 +386,9 @@
|
||||
"9.9.21-39038": {
|
||||
"appid": 537313906,
|
||||
"qua": "V1_WIN_NQ_9.9.21_39038_GW_B"
|
||||
},
|
||||
"9.9.22-40362": {
|
||||
"appid": 537314212,
|
||||
"qua": "V1_WIN_NQ_9.9.22_40362_GW_B"
|
||||
}
|
||||
}
|
||||
6
src/core/external/offset.json
vendored
6
src/core/external/offset.json
vendored
@@ -507,8 +507,12 @@
|
||||
"send": "7B025C8",
|
||||
"recv": "7B05F58"
|
||||
},
|
||||
"9.9.21-39038-x64": {
|
||||
"9.9.21-39038-x64": {
|
||||
"send": "313FB58",
|
||||
"recv": "31432FC"
|
||||
},
|
||||
"9.9.22-40362": {
|
||||
"send": "31C0EB8",
|
||||
"recv": "31C465C"
|
||||
}
|
||||
}
|
||||
@@ -22,9 +22,8 @@ export class MoveGroupFile extends GetPacketStatusDepends<Payload, MoveGroupFile
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file_id) || FileNapCatOneBotUUID.decodeModelId(payload.file_id);
|
||||
const fileUUID = contextMsgFile?.fileUUID || contextMsgFile?.fileId;
|
||||
if (fileUUID) {
|
||||
await this.core.apis.PacketApi.pkt.operation.MoveGroupFile(+payload.group_id, fileUUID, payload.current_parent_directory, payload.target_parent_directory);
|
||||
if (contextMsgFile?.fileUUID) {
|
||||
await this.core.apis.PacketApi.pkt.operation.MoveGroupFile(+payload.group_id, contextMsgFile.fileUUID, payload.current_parent_directory, payload.target_parent_directory);
|
||||
return {
|
||||
ok: true,
|
||||
};
|
||||
|
||||
@@ -22,9 +22,8 @@ export class RenameGroupFile extends GetPacketStatusDepends<Payload, RenameGroup
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file_id) || FileNapCatOneBotUUID.decodeModelId(payload.file_id);
|
||||
const fileUUID = contextMsgFile?.fileUUID || contextMsgFile?.fileId;
|
||||
if (fileUUID) {
|
||||
await this.core.apis.PacketApi.pkt.operation.RenameGroupFile(+payload.group_id, fileUUID, payload.current_parent_directory, payload.new_name);
|
||||
if (contextMsgFile?.fileUUID) {
|
||||
await this.core.apis.PacketApi.pkt.operation.RenameGroupFile(+payload.group_id, contextMsgFile.fileUUID, payload.current_parent_directory, payload.new_name);
|
||||
return {
|
||||
ok: true,
|
||||
};
|
||||
|
||||
@@ -20,9 +20,8 @@ export class TransGroupFile extends GetPacketStatusDepends<Payload, TransGroupFi
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file_id) || FileNapCatOneBotUUID.decodeModelId(payload.file_id);
|
||||
const fileUUID = contextMsgFile?.fileUUID || contextMsgFile?.fileId;
|
||||
if (fileUUID) {
|
||||
const result = await this.core.apis.GroupApi.transGroupFile(payload.group_id.toString(), fileUUID);
|
||||
if (contextMsgFile?.fileUUID) {
|
||||
const result = await this.core.apis.GroupApi.transGroupFile(payload.group_id.toString(), contextMsgFile.fileUUID);
|
||||
if (result.transGroupFileResult.result.retCode === 0) {
|
||||
return {
|
||||
ok: true
|
||||
|
||||
@@ -20,10 +20,9 @@ export class GetGroupFileUrl extends GetPacketStatusDepends<Payload, GetGroupFil
|
||||
|
||||
async _handle(payload: Payload) {
|
||||
const contextMsgFile = FileNapCatOneBotUUID.decode(payload.file_id) || FileNapCatOneBotUUID.decodeModelId(payload.file_id);
|
||||
const fileUUID = contextMsgFile?.fileUUID || contextMsgFile?.fileId;
|
||||
if (fileUUID) {
|
||||
if (contextMsgFile?.fileUUID) {
|
||||
return {
|
||||
url: await this.core.apis.PacketApi.pkt.operation.GetGroupFileUrl(+payload.group_id, fileUUID)
|
||||
url: await this.core.apis.PacketApi.pkt.operation.GetGroupFileUrl(+payload.group_id, contextMsgFile.fileUUID)
|
||||
};
|
||||
}
|
||||
throw new Error('real fileUUID not found!');
|
||||
|
||||
@@ -16,7 +16,7 @@ export class DeleteGroupFile extends OneBotAction<Payload, Awaited<ReturnType<NT
|
||||
override actionName = ActionName.GOCQHTTP_DeleteGroupFile;
|
||||
override payloadSchema = SchemaData;
|
||||
async _handle(payload: Payload) {
|
||||
const data = FileNapCatOneBotUUID.decode(payload.file_id) || FileNapCatOneBotUUID.decodeModelId(payload.file_id);
|
||||
const data = FileNapCatOneBotUUID.decodeModelId(payload.file_id);
|
||||
if (!data || !data.fileId) throw new Error('Invalid file_id');
|
||||
return await this.core.apis.GroupApi.delGroupFile(payload.group_id.toString(), [data.fileId]);
|
||||
}
|
||||
|
||||
@@ -578,7 +578,7 @@ export class OneBotMsgApi {
|
||||
};
|
||||
}
|
||||
|
||||
if (!context.peer || context.peer.chatType == ChatType.KCHATTYPEC2C) return undefined;
|
||||
if (!context.peer || !atQQ || context.peer.chatType == ChatType.KCHATTYPEC2C) return undefined; // 过滤掉空atQQ
|
||||
if (atQQ === 'all') return at(atQQ, atQQ, NTMsgAtType.ATTYPEALL, '全体成员');
|
||||
const atMember = await this.core.apis.GroupApi.getGroupMember(context.peer.peerUid, atQQ);
|
||||
if (atMember) {
|
||||
|
||||
Reference in New Issue
Block a user