Skip to content

Commit aba6d83

Browse files
committed
fix:修复重大bug
1 parent 10686d9 commit aba6d83

File tree

9 files changed

+41
-8
lines changed

9 files changed

+41
-8
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,4 @@ dist
135135
/js/UC分享.js
136136
/json/UC分享.json
137137
/jx/奇奇.js
138+
/js/百忙无果[].js

Diff for: controllers/api.js

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export default (fastify, options, done) => {
111111
// 根据 query 参数决定执行逻辑
112112
if ('play' in query) {
113113
// 处理播放逻辑
114+
// console.log('play query:', query);
114115
const result = await drpy.play(modulePath, env, query.flag, query.play);
115116
return reply.send(result);
116117
}

Diff for: custom.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sites_count": 72,
2+
"sites_count": 73,
33
"sites": [
44
{
55
"key": "drpyS_设置中心",
@@ -313,6 +313,16 @@
313313
"quickSearch": 0,
314314
"ext": ""
315315
},
316+
{
317+
"key": "drpyS_百忙无果[官]",
318+
"name": "百忙无果[官](DS)",
319+
"type": 4,
320+
"api": "http://localhost:5757/api/百忙无果[官]",
321+
"searchable": 2,
322+
"filterable": 1,
323+
"quickSearch": 0,
324+
"ext": ""
325+
},
316326
{
317327
"key": "push_agent",
318328
"name": "推送(DS)",

Diff for: docs/updateRecord.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
6. 优化 batchFetch 函数的性能开销
1313
7. 新增 `小米盘搜[搜].js`
1414
8. 统一给所有函数的this指针绑定HOST变量
15+
9. 紧急修复了一个bug,影响全局的接口query解析
1516

1617
### 20250110
1718

Diff for: index.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,19 @@ fastify.addHook('preHandler', (req, reply, done) => {
4646

4747
// 自定义插件替换 querystring 解析行为.避免出现两个相同参数被解析成列表
4848
fastify.addHook('onRequest', async (request, reply) => {
49-
const rawQuery = request.raw.url.split('?')[1] || '';
49+
// 获取原始 URL 中的 query 部分
50+
const rawUrl = request.raw.url;
51+
const urlParts = rawUrl.split('?');
52+
const path = urlParts[0];
53+
let rawQuery = urlParts.slice(1).join('?'); // 处理可能存在的多个 '?' 情况
54+
// log('rawQuery:', rawQuery);
55+
// 使用 qs 库解析 query 参数,确保兼容参数值中包含 '?' 的情况
5056
request.query = qs.parse(rawQuery, {
5157
strictNullHandling: true, // 确保 `=` 被解析为空字符串
5258
arrayLimit: 100, // 自定义数组限制
5359
allowDots: false, // 禁止点号表示嵌套对象
5460
});
61+
// 如果需要,可以在这里对 request.query 进行进一步处理
5562
});
5663

5764
// 注册控制器

Diff for: index.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sites_count": 72,
2+
"sites_count": 73,
33
"sites": [
44
{
55
"key": "drpyS_设置中心",
@@ -313,6 +313,16 @@
313313
"quickSearch": 0,
314314
"ext": ""
315315
},
316+
{
317+
"key": "drpyS_百忙无果[官]",
318+
"name": "百忙无果[官](DS)",
319+
"type": 4,
320+
"api": "http://localhost:5757/api/百忙无果[官]",
321+
"searchable": 2,
322+
"filterable": 1,
323+
"quickSearch": 0,
324+
"ext": ""
325+
},
316326
{
317327
"key": "push_agent",
318328
"name": "推送(DS)",

Diff for: libs/drpyS.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1128,19 +1128,22 @@ async function searchParseAfter(d, pg) {
11281128

11291129
async function playParse(rule, flag, id, flags) {
11301130
let url = id;
1131-
log('playParse:', url)
11321131
if (!/http/.test(url)) {
11331132
try {
11341133
url = base64Decode(url);
1135-
log('base64')
1134+
log('[playParse]: id is base64 data');
11361135
} catch (e) {
11371136
}
11381137
}
11391138
url = decodeURIComponent(url);
11401139
if (!/^http/.test(url)) {
11411140
url = id;
11421141
}
1143-
// log('playParse:', url)
1142+
if (id !== url) {
1143+
log(`[playParse]: ${id} => ${url}`);
1144+
} else {
1145+
log(`[playParse]: ${url}`);
1146+
}
11441147
const jsp = new jsoup(url);
11451148
return {
11461149
TYPE: 'play',

Diff for: package.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import url from 'url';
77
const EXCLUDE_DIRS = ['.git', '.idea', 'soft', 'pyTools', 'drop_code', 'jstest', 'local', 'logs', '对话1.txt'];
88

99
// 要排除的文件列表
10-
const EXCLUDE_FILES = ['config/env.json', '.env', 'js/UC分享.js', 'json/UC分享.json', 'jx/奇奇.js'];
10+
const EXCLUDE_FILES = ['config/env.json', '.env', 'js/UC分享.js', 'js/百忙无果[官].js', 'json/UC分享.json', 'jx/奇奇.js'];
1111

1212
// 获取脚本所在目录
1313
const getScriptDir = () => dirname(resolve(url.fileURLToPath(import.meta.url)));

Diff for: package.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
EXCLUDE_DIRS = ['.git', '.idea', 'soft', 'pyTools', 'drop_code', 'jstest', 'local', 'logs', '对话1.txt']
88

99
# 要排除的文件列表
10-
EXCLUDE_FILES = ['config/env.json', '.env','js/UC分享.js','json/UC分享.json','jx/奇奇.js']
10+
EXCLUDE_FILES = ['config/env.json', '.env','js/UC分享.js','js/百忙无果[官].js','json/UC分享.json','jx/奇奇.js']
1111

1212
def get_script_dir():
1313
"""

0 commit comments

Comments
 (0)