Skip to content

Commit

Permalink
fix: 终于修复了未绑定用户鸣潮抽卡记录获取异常
Browse files Browse the repository at this point in the history
  • Loading branch information
TomyJan committed Jul 2, 2024
1 parent ee99d58 commit 5cc5f44
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion model/kuroApiHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class kuroApiHandler {
* 取库洛接口返回
* 调用其他接口前请先校验 token 有效性
* @param {string} ApiName 接口名称
* @param {string|boolean} kuroUid 库洛 ID, sdkLogin 和 mcGachaRecord 传入 false
* @param {string|boolean} kuroUid 库洛 ID, 不需要的接口 传入 114514
* @param {string} token 库洛 ID 的 token
* @param {object} data 传入数据
* @returns {JSON|string} 接口返回的 原始 json 或者报错信息
Expand Down
8 changes: 8 additions & 0 deletions model/userConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export default class userConfig {
let kuroUidToFetch = Object.keys(tokenData)[kuroUidIndex]
let kuroapi = new kuroApi(qq)
do {
if (!kuroUidToFetch) {
kuroLogger.warn(`用户 ${qq} 没有绑定 token, 无法通过 api 遍历找出 uid`)
break
}
let rsp_roleList = await kuroapi.roleList(kuroUidToFetch, { gameId })
if (typeof rsp_roleList !== 'string') {
if (rsp_roleList.data.length > 0) {
Expand Down Expand Up @@ -224,6 +228,10 @@ export default class userConfig {
let kuroUidToFetch = Object.keys(tokenData)[kuroUidIndex]
let kuroapi = new kuroApi(qq)
do {
if (!kuroUidToFetch) {
kuroLogger.warn(`用户 ${qq} 没有绑定 token, 无法通过 api 遍历找出 uid`)
break
}
let rsp_roleList = await kuroapi.roleList(kuroUidToFetch, { gameId })
if (typeof rsp_roleList !== 'string') {
if (rsp_roleList.data.length > 0) {
Expand Down

0 comments on commit 5cc5f44

Please sign in to comment.