Skip to content

[Bug反馈]: 吉利银河最近的脚本出问题了 #276

Open

Description

@gethin52

脚本名字

吉利银河脚本

实际的结果是什么? 期望的结果是什么?

如果隔一段时间没有通过手机APP打开吉利银河APP,那么执行脚本会报错,错误日志如下日志记录。若是先打开吉利银河APP,就可以正常执行脚本签到。怀疑是刷新token的问题

日志记录(可选)

## 开始执行... 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

  1. 1466810054 commented on Dec 4, 2025

    @1466810054
    Collaborator
  2. gethin52 commented on Dec 15, 2025

    @gethin52
    Author

    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 秒     

  3. smallfawn commented on Apr 1, 2026

    @smallfawn
    Owner

    行

  4. smallfawn commented on Aug 20, 2026

    @smallfawn
    Owner

    已修复,提交 9e13e37。

    根因:httpRequest 在请求出错或响应为空时执行的是 resolve()(返回 undefined),而调用方直接读 result.code,于是抛

    TypeError: Cannot read properties of undefined (reading 'code')
    

    出现在 refresh_token / signstate / sign / points 四处 —— 这正是你描述的「隔一段时间没打开 APP 就报错」:refreshToken 过期后接口失败,脚本以崩溃收场而不是给出可读原因。

    改动:

    • httpRequest 失败/空响应时返回 { __requestFailed: true } 而非 undefined
    • 四处调用点改用可选链,并在请求失败时输出明确提示:「refreshToken 可能已过期,请先用手机打开一次「吉利银河」APP 刷新登录态后再跑」
    • points 的积分字段加了兜底

    也就是说:token 过期时不再崩栈,而是直接告诉你该去刷新登录态。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions