mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-06-13 18:55:07 +00:00
Squashed commit of the following:
commit 02242eecf6ceadf8be32466502d4ab531e7dfc65
Author: Sunset Mikoto <26019675+SunsetMkt@users.noreply.github.com>
Date: Sun May 24 18:00:36 2026 +0000
fix: randomCNIP 不工作
This commit is contained in:
parent
269456def3
commit
1b4af30a49
12
server.js
12
server.js
@ -303,8 +303,13 @@ async function constructServer(moduleDefs) {
|
|||||||
// 参数注入客户端IP
|
// 参数注入客户端IP
|
||||||
const obj = [...params]
|
const obj = [...params]
|
||||||
const options = obj[2] || {}
|
const options = obj[2] || {}
|
||||||
if (!options.randomCNIP) {
|
let ip = ''
|
||||||
let ip = req.ip
|
|
||||||
|
if (options.randomCNIP) {
|
||||||
|
ip = global.cnIp
|
||||||
|
// logger.info('Using random Chinese IP for request:', ip)
|
||||||
|
} else {
|
||||||
|
ip = req.ip
|
||||||
|
|
||||||
if (ip.substring(0, 7) == '::ffff:') {
|
if (ip.substring(0, 7) == '::ffff:') {
|
||||||
ip = ip.substring(7)
|
ip = ip.substring(7)
|
||||||
@ -313,11 +318,12 @@ async function constructServer(moduleDefs) {
|
|||||||
ip = global.cnIp
|
ip = global.cnIp
|
||||||
}
|
}
|
||||||
// logger.info('Requested from ip:', ip)
|
// logger.info('Requested from ip:', ip)
|
||||||
|
}
|
||||||
|
|
||||||
obj[2] = {
|
obj[2] = {
|
||||||
...options,
|
...options,
|
||||||
ip,
|
ip,
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return request(...obj)
|
return request(...obj)
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user