### 脚本名字 吉利银河脚本 ### 实际的结果是什么? 期望的结果是什么? 如果隔一段时间没有通过手机APP打开吉利银河APP,那么执行脚本会报错,错误日志如下日志记录。若是先打开吉利银河APP,就可以正常执行脚本签到。怀疑是刷新token的问题 ### 日志记录(可选) ```javascript ## 开始执行... 2025-12-04 08:05:00 🔔吉利银河,开始! get请求失败 ❗️吉利银河,错误! TypeError: Cannot read properties of undefined (reading 'code') at UserInfo.refresh_token (/ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:205:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:313:5 get请求失败 ❗️吉利银河,错误! TypeError: Cannot read properties of undefined (reading 'code') at UserInfo.signstate (/ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:230:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async UserInfo.sign (/ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:252:36) at async /ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:315:9 post请求失败 ❗️吉利银河,错误! TypeError: Cannot read properties of undefined (reading 'code') at UserInfo.sign (/ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:270:24) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async /ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:315:9 🔔吉利银河,结束!🕛41.921秒 ## 执行结束... 2025-12-04 08:05:43 耗时 43 秒 ``` ### 简单的复现代码/链接(可选) _No response_
Activity
1466810054 commentedon Dec 4, 2025
gethin52 commentedon Dec 15, 2025
get请求失败
❗️吉利银河,错误!
TypeError: Cannot read properties of undefined (reading 'code')
⚠️ 失败原因: {
⚠️ 失败原因: {
at UserInfo.refresh_token (/ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:205:24)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /ql/data/scripts/smallfawn_QLScriptPublic_main/jlyh.js:313:5
❌查询签到状态失败!
code: 'user-login-invalid-expired',
msg: '登录信息失效,请重新登录',
data: null,
traceId: 'eeb3487853010416074555c17bc7e1030',
success: false
}
❌签到失败!
code: 'user-login-invalid-expired',
msg: '登录信息失效,请重新登录',
data: null,
traceId: '4331d3400aa3959d7545364f5f0',
success: false
}
RequestError: getaddrinfo EAI_AGAIN v1.hitokoto.cn
at ClientRequest. (/ql/node_modules/.pnpm/got@11.8.6/node_modules/got/dist/source/core/index.js:970:111)
at Object.onceWrapper (node:events:634:26)
at ClientRequest.emit (node:events:531:35)
at origin.emit (/ql/node_modules/.pnpm/@szmarczak+http-timer@4.0.6/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
at TLSSocket.socketErrorListener (node:_http_client:500:9)
at TLSSocket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
code: 'EAI_AGAIN',
timings: {
start: 1765757140190,
socket: 1765757140192,
lookup: 1765757145193,
connect: undefined,
secureConnect: undefined,
upload: undefined,
response: undefined,
end: undefined,
error: 1765757145194,
abort: undefined,
phases: {
wait: 2,
dns: 5001,
tcp: undefined,
tls: undefined,
request: undefined,
firstByte: undefined,
download: undefined,
total: 5004
}
}
}
🔔吉利银河,结束!🕛44.019秒
执行结束... 2025-12-15 08:05:45 耗时 45 秒
smallfawn commentedon Apr 1, 2026
行
fix(jlyh): 请求失败不再抛 TypeError,改为明确的登录态失效提示(#276)
smallfawn commentedon Aug 20, 2026
已修复,提交
9e13e37。根因:
httpRequest在请求出错或响应为空时执行的是resolve()(返回undefined),而调用方直接读result.code,于是抛出现在
refresh_token/signstate/sign/points四处 —— 这正是你描述的「隔一段时间没打开 APP 就报错」:refreshToken过期后接口失败,脚本以崩溃收场而不是给出可读原因。改动:
httpRequest失败/空响应时返回{ __requestFailed: true }而非undefinedpoints的积分字段加了兜底也就是说:token 过期时不再崩栈,而是直接告诉你该去刷新登录态。