mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2026-11-05 22:36:53 +08:00
吉利银河:httpRequest 在请求出错/响应为空时 resolve() 返回 undefined,
调用方直接读 result.code 触发
TypeError: Cannot read properties of undefined (reading 'code')
(refresh_token:205 / signstate:230 / sign / points 四处)。
这正是 issue 描述的「隔一段时间没打开APP就报错」——refreshToken 过期后
接口失败,脚本以崩溃收场而非给出可读原因。
改动:
- httpRequest 失败/空响应时返回 { __requestFailed: true } 而非 undefined
- 四处调用点改用可选链,并在 __requestFailed 时输出明确提示:
「refreshToken 可能已过期,请先用手机打开一次「吉利银河」APP 刷新登录态后再跑」
- points 的积分字段也加了可选链兜底
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>