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
-1
@@ -5,7 +5,7 @@
|
||||
// 端点:/yyting/search/searchBatch.action(q=2150)
|
||||
// 注意:章节/取流 App 端点(q=1930/2224)游客 token 已失效(482 请登录),取流走 web 通道(见 apis/lr.ts)
|
||||
import crypto from 'node:crypto'
|
||||
import { httpFetch } from '../request.ts'
|
||||
import { httpFetch } from '../common/request.ts'
|
||||
|
||||
const DOMAIN = 'http://dapis.mting.info'
|
||||
const SECRET = 'iJ0DgxmdC83#I&j@iwg'
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// 参考社区下载器(yoval/lrts 等):POST form {account, pwd: base64(password)},
|
||||
// 成功响应 json.phone 非空,Set-Cookie 种下会话;取流接口必须携带该会话
|
||||
// (免费章节匿名也返回"收费章节未购买",2026-10-02 实测)。
|
||||
import { httpFetch } from '../request.ts'
|
||||
import { httpFetch } from '../common/request.ts'
|
||||
import { getCredentials, setCredentials } from '../auth/store.ts'
|
||||
|
||||
const UA_MI = 'Mozilla/5.0 (Linux; U; Android 4.1.1; zh-cn; MI2 Build/JRO03L) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0'
|
||||
|
||||
+1
-3
@@ -5,15 +5,13 @@
|
||||
import lrApi from '../apis/lr.ts'
|
||||
import musicSearch from './musicSearch.ts'
|
||||
import { getBookMenu } from './menu.ts'
|
||||
import { getLrCookie } from './auth.ts'
|
||||
|
||||
const lr = {
|
||||
musicSearch,
|
||||
getMusicUrl(songInfo, type) {
|
||||
return lrApi.getMusicUrl(songInfo, type)
|
||||
},
|
||||
getPic(songInfo) {
|
||||
const bookId = String(songInfo.songmid ?? '').split(':')[0]
|
||||
getPic() {
|
||||
// 书籍封面无独立免签接口;搜索结果的 img 字段已带封面(这里返回空由调用方回退)
|
||||
return Promise.resolve(null)
|
||||
},
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// 接口: https://m.lrts.me/ajax/getBookMenu?bookId=&pageNum=&pageSize=&sortType=0
|
||||
// 实测(2026-10-02)匿名可用;章节条目 {section, name, listenPrice, state}
|
||||
// 注意:专辑类内容用 getAlbumAudios(entityType=2),本实现仅收书(entityType=3)
|
||||
import { httpFetch } from '../request.ts'
|
||||
import { httpFetch } from '../common/request.ts'
|
||||
|
||||
const UA_MI = 'Mozilla/5.0 (Linux; U; Android 4.1.1; zh-cn; MI2 Build/JRO03L) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 XiaoMi/MiuiBrowser/1.0'
|
||||
const MENU_URL = 'https://m.lrts.me/ajax/getBookMenu'
|
||||
|
||||
Reference in new issue
Block a user