Merge branch "Burial0268/main" into "main"

This commit is contained in:
ElyPrism 2026-02-12 19:28:43 +08:00 committed by GitHub
commit 7fceec12e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -227,6 +227,7 @@ async function consturctServer(moduleDefs) {
const moduleResponse = await moduleDef.module(query, (...params) => { const moduleResponse = await moduleDef.module(query, (...params) => {
// 参数注入客户端IP // 参数注入客户端IP
const obj = [...params] const obj = [...params]
// 获取请求中的 IP 参数
let ip = req.ip let ip = req.ip
if (ip.substring(0, 7) == '::ffff:') { if (ip.substring(0, 7) == '::ffff:') {
@ -236,8 +237,8 @@ async function consturctServer(moduleDefs) {
ip = global.cnIp ip = global.cnIp
} }
// logger.info('Requested from ip:', ip) // logger.info('Requested from ip:', ip)
obj[3] = { obj[2] = {
...obj[3], ...(obj[2] || {}),
ip, ip,
} }
return request(...obj) return request(...obj)