mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-06-10 23:47:29 +00:00
fix: 修复前端错误信息丢失 & QQscTool filesetId 提取失败
- 前端 axios 对 HTTP 非2xx直接reject,catch块丢失后端错误信息,从 error.response.data.msg 提取实际错误展示给用户 - QQscTool extractFilesetId 正则未适配 Nuxt 转义JSON格式
This commit is contained in:
@@ -281,9 +281,11 @@ public class QQscTool extends PanBase {
|
||||
* 从 HTML 的 __NUXT_DATA__ 中提取 fileset_id
|
||||
*/
|
||||
String extractFilesetId(String html) {
|
||||
// 匹配 UUID 格式的 fileset_id(出现在 Nuxt 数据的 fileset_id 字段值位置)
|
||||
// Nuxt __NUXT_DATA__ 中 fileset_id 出现在缓存 key 的嵌套转义 JSON 中:
|
||||
// {\"fileset_id\":\"0500417e-5431-433f-a9f3-d5ccf9412da3\"}
|
||||
// 匹配 \"fileset_id\" 后面最近的 UUID
|
||||
Pattern pattern = Pattern.compile(
|
||||
"\"fileset_id\"[:\\s]*\"([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})\"");
|
||||
"\\\\\"fileset_id\\\\\"[^a-f0-9]*([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})");
|
||||
Matcher matcher = pattern.matcher(html);
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
|
||||
Reference in New Issue
Block a user