refactor(sdk): 审计 P2 卫生项清理——请求层收敛与死代码清除
- 删除旧 sdk/request.ts,全部 import 收敛到 sdk/common/request.ts(85 文件) - 注释死代码 630+ 行、裸 console.log 吞错 6 处、未使用符号 26 处清零 - bili 状态校验去重;utils DNS 预解析失败日志改 warn 带上下文 - CODE-AUDIT.md:第四节 P2 清理记录 + 第八节线索逐条复核结论(kw/kg/tx/wy parse 骨架相似实质各异,不抽公共层)
This commit is contained in:
1 parent
ecca1b8458
commit
8c02fb5c15
85 files changed
+112
-839
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { httpFetch } from '../request.ts'
|
||||
import { httpFetch } from '../common/request.ts'
|
||||
import { weapi } from './utils/crypto.ts'
|
||||
import { formatPlayTime, sizeFormate } from '../index.ts'
|
||||
// https://github.com/Binaryify/NeteaseCloudMusicApi/blob/master/module/song_detail.js
|
||||
@@ -12,7 +12,6 @@ export default {
|
||||
return arr.join('、')
|
||||
},
|
||||
filterList({ songs, privileges }) {
|
||||
// console.log(songs, privileges)
|
||||
const list: any[] = []
|
||||
songs.forEach((item, index) => {
|
||||
const types: Array<{ type: string, size: string | null }> = []
|
||||
@@ -87,7 +86,6 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
// console.log(list)
|
||||
return list
|
||||
},
|
||||
async getList(ids = [], retryNum = 0) {
|
||||
@@ -106,7 +104,6 @@ export default {
|
||||
})
|
||||
const { body, statusCode } = await requestObj.promise
|
||||
if (statusCode != 200 || body.code !== 200) throw new Error('获取歌曲详情失败')
|
||||
// console.log(body)
|
||||
return { source: 'wy', list: this.filterList(body) }
|
||||
},
|
||||
}
|
||||
Reference in new issue
Block a user