mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
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:
@@ -55,7 +55,7 @@ const NetworkFormModal = <T extends keyof OneBotConfig['network']> (
|
|||||||
|
|
||||||
if (['httpServers', 'httpSseServers', 'websocketServers'].includes(field)) {
|
if (['httpServers', 'httpSseServers', 'websocketServers'].includes(field)) {
|
||||||
const serverData = data as any;
|
const serverData = data as any;
|
||||||
if (!serverData.token) {
|
if (!serverData.token && serverData.host !== '127.0.0.1') {
|
||||||
await new Promise<void>((resolve, reject) => {
|
await new Promise<void>((resolve, reject) => {
|
||||||
dialog.confirm({
|
dialog.confirm({
|
||||||
title: '安全警告',
|
title: '安全警告',
|
||||||
|
|||||||
Reference in New Issue
Block a user