Skip to content

Commit f793f5a

Browse files
细节优化
1 parent 9182580 commit f793f5a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config/default_config/bot.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ log_align: " TRSSYz "
99
# 插件加载超时
1010
plugin_load_timeout: 60
1111
# 监听文件变化
12-
file_watch: true
12+
file_watch: false
1313

1414
# 自动更新时间
1515
update_time: 1440

lib/bot.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default class Yunzai extends EventEmitter {
102102
return req.next()
103103

104104
for (const i in cfg.server.auth) {
105-
if (req.query[i] === cfg.server.auth[i] || req.headers[i.toLowerCase()] === cfg.server.auth[i])
105+
if (req.headers[i.toLowerCase()] === cfg.server.auth[i] || req.query[i] === cfg.server.auth[i])
106106
continue
107107
req.res?.sendStatus(401)
108108

@@ -139,7 +139,7 @@ export default class Yunzai extends EventEmitter {
139139
}
140140

141141
async serverExit(req) {
142-
if ("::1" !== req.ip && "::ffff:127.0.0.1" !== req.ip && req.hostname !== "localhost") return
142+
if (req.ip !== "::1" && req.ip !== "::ffff:127.0.0.1" && req.hostname !== "localhost") return
143143
if (process.env.app_type === "pm2")
144144
await this.exec("pnpm stop")
145145
process.exit(1)

0 commit comments

Comments
 (0)