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:
手瓜一十雪
2026-02-18 22:14:31 +08:00
parent b9f61cc0ee
commit a3b3836b8a
8 changed files with 51 additions and 55 deletions

View File

@@ -10,20 +10,20 @@ import QQManager from '@/controllers/qq_manager';
interface BypassFormData {
hook: boolean;
module: boolean;
window: boolean;
js: boolean;
module: boolean;
process: boolean;
container: boolean;
maps: boolean;
js: boolean;
}
const defaultBypass: BypassFormData = {
hook: true,
module: true,
window: true,
js: true,
module: true,
process: true,
container: true,
maps: true,
js: true,
};
const BypassConfigCard = () => {
@@ -43,11 +43,11 @@ const BypassConfigCard = () => {
const config = await QQManager.getNapCatConfig();
const bypass = config.bypass ?? defaultBypass;
setValue('hook', bypass.hook ?? true);
setValue('module', bypass.module ?? true);
setValue('window', bypass.window ?? true);
setValue('js', bypass.js ?? true);
setValue('module', bypass.module ?? true);
setValue('process', bypass.process ?? true);
setValue('container', bypass.container ?? true);
setValue('maps', bypass.maps ?? true);
setValue('js', bypass.js ?? true);
if (showTip) toast.success('刷新成功');
} catch (error) {
const msg = (error as Error).message;
@@ -101,17 +101,6 @@ const BypassConfigCard = () => {
/>
)}
/>
<Controller
control={control}
name='module'
render={({ field }) => (
<SwitchCard
{...field}
label='Module'
description='加载模块隐藏'
/>
)}
/>
<Controller
control={control}
name='window'
@@ -125,12 +114,23 @@ const BypassConfigCard = () => {
/>
<Controller
control={control}
name='js'
name='module'
render={({ field }) => (
<SwitchCard
{...field}
label='JS'
description='JS Bypass保留'
label='Module'
description='加载模块隐藏'
/>
)}
/>
<Controller
control={control}
name='process'
render={({ field }) => (
<SwitchCard
{...field}
label='Process'
description='进程反检测'
/>
)}
/>
@@ -147,12 +147,12 @@ const BypassConfigCard = () => {
/>
<Controller
control={control}
name='maps'
name='js'
render={({ field }) => (
<SwitchCard
{...field}
label='Maps'
description='linux maps反检测'
label='JS'
description='JS反检测'
/>
)}
/>

View File

@@ -1,10 +1,10 @@
interface BypassOptions {
hook: boolean;
module: boolean;
window: boolean;
js: boolean;
module: boolean;
process: boolean;
container: boolean;
maps: boolean;
js: boolean;
}
interface NapCatConfig {