fix: 修复前端错误信息丢失 & QQscTool filesetId 提取失败

- 前端 axios 对 HTTP 非2xx直接reject,catch块丢失后端错误信息,从 error.response.data.msg 提取实际错误展示给用户

- QQscTool extractFilesetId 正则未适配 Nuxt 转义JSON格式
This commit is contained in:
yukaidi
2026-05-29 13:45:57 +08:00
parent 9b70fb2778
commit 79fab8c0d6
5 changed files with 29 additions and 11 deletions

View File

@@ -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);