mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-03-01 08:10:25 +00:00
Add process bypass option and update bypass fields
Introduce a new 'process' bypass option and remove the old 'maps' key, updating all related schemas, types, defaults and validation. Adjusted napcat.json ordering and NapcatConfig defaults, updated BypassOptions schema and TypeScript interfaces, backend validation keys, loader/default parsing logic, and the web UI form mappings/labels to reflect the new field set and ordering.
This commit is contained in:
@@ -16,11 +16,11 @@ const defaultNapcatConfig = {
|
||||
o3HookMode: 1,
|
||||
bypass: {
|
||||
hook: true,
|
||||
module: true,
|
||||
window: true,
|
||||
js: true,
|
||||
module: true,
|
||||
process: true,
|
||||
container: true,
|
||||
maps: true,
|
||||
js: true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -81,7 +81,7 @@ export const NapCatSetConfigHandler: RequestHandler = (req, res) => {
|
||||
// 验证 bypass 字段
|
||||
if (mergedConfig.bypass && typeof mergedConfig.bypass === 'object') {
|
||||
const bypass = mergedConfig.bypass as Record<string, unknown>;
|
||||
const validKeys = ['hook', 'module', 'window', 'js', 'container', 'maps'];
|
||||
const validKeys = ['hook', 'window', 'module', 'process', 'container', 'js'];
|
||||
for (const key of validKeys) {
|
||||
if (key in bypass && typeof bypass[key] !== 'boolean') {
|
||||
return sendError(res, `bypass.${key} must be boolean`);
|
||||
|
||||
Reference in New Issue
Block a user