mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-03-21 11:03:15 +00:00
fix: 修复注入随机ip不生效
This commit is contained in:
parent
f08f192328
commit
bc9d7b949f
@ -7,9 +7,9 @@
|
|||||||
!/app.js
|
!/app.js
|
||||||
!/server.js
|
!/server.js
|
||||||
!/package.json
|
!/package.json
|
||||||
!/package-lock.json
|
|
||||||
!/index.js
|
!/index.js
|
||||||
!/generateConfig.js
|
!/generateConfig.js
|
||||||
!/main.js
|
!/main.js
|
||||||
!/data
|
!/data
|
||||||
!/.env
|
!/.env
|
||||||
|
!/pnpm-lock.yaml
|
||||||
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@ -16,7 +16,7 @@ updates:
|
|||||||
# 自动合并小版本更新的 PR (可选)
|
# 自动合并小版本更新的 PR (可选)
|
||||||
# 可以设置针对 patch 或 minor 版本更新自动合并
|
# 可以设置针对 patch 或 minor 版本更新自动合并
|
||||||
commit-message:
|
commit-message:
|
||||||
prefix: "chore(packages):" # PR 合并提交信息的前缀
|
prefix: "build(packages):" # PR 合并提交信息的前缀
|
||||||
|
|
||||||
# 更新 GitHub Actions 依赖
|
# 更新 GitHub Actions 依赖
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
网易云音乐 NodeJS API Enhanced
|
网易云音乐 NodeJS API Enhanced
|
||||||
|
|
||||||
|
最后更新于: 2026.2.15
|
||||||
|
|
||||||
## 灵感来自
|
## 灵感来自
|
||||||
|
|
||||||
[disoul/electron-cloud-music](https://github.com/disoul/electron-cloud-music)
|
[disoul/electron-cloud-music](https://github.com/disoul/electron-cloud-music)
|
||||||
|
|||||||
@ -227,7 +227,8 @@ 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 参数
|
const options = obj[2] || {}
|
||||||
|
if (!options.randomCNIP) {
|
||||||
let ip = req.ip
|
let ip = req.ip
|
||||||
|
|
||||||
if (ip.substring(0, 7) == '::ffff:') {
|
if (ip.substring(0, 7) == '::ffff:') {
|
||||||
@ -238,9 +239,11 @@ async function consturctServer(moduleDefs) {
|
|||||||
}
|
}
|
||||||
// logger.info('Requested from ip:', ip)
|
// logger.info('Requested from ip:', ip)
|
||||||
obj[2] = {
|
obj[2] = {
|
||||||
...(obj[2] || {}),
|
...options,
|
||||||
ip,
|
ip,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return request(...obj)
|
return request(...obj)
|
||||||
})
|
})
|
||||||
logger.info(`Request Success: ${decode(req.originalUrl)}`)
|
logger.info(`Request Success: ${decode(req.originalUrl)}`)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user