Add token check exception for localhost servers

Updated the network form modal to allow missing tokens only for servers with host '127.0.0.1'. This enhances security by prompting a warning when a token is missing for non-localhost servers.
This commit is contained in:
手瓜一十雪 2026-01-24 12:24:57 +08:00
parent c2d3a8034d
commit 19766002ae

View File

@ -55,7 +55,7 @@ const NetworkFormModal = <T extends keyof OneBotConfig['network']> (
if (['httpServers', 'httpSseServers', 'websocketServers'].includes(field)) {
const serverData = data as any;
if (!serverData.token) {
if (!serverData.token && serverData.host !== '127.0.0.1') {
await new Promise<void>((resolve, reject) => {
dialog.confirm({
title: '安全警告',