修正enka天赋获取错误问题

This commit is contained in:
Kokomi 2022-11-08 14:42:24 +08:00
parent a5b15e232e
commit 7fcbe22c3d
2 changed files with 8 additions and 5 deletions

View File

@ -171,11 +171,14 @@ let EnkaData = {
let tid = talentId[id] let tid = talentId[id]
key = talentKey[tid] key = talentKey[tid]
elem = elem || talentElem[tid] elem = elem || talentElem[tid]
ret[key] = {
original: lv
}
} else { } else {
key = ['a', 'e', 'q'][idx++] key = ['a', 'e', 'q'][idx++]
} ret[key] = ret[key] || {
ret[key] = ret[key] || { original: lv
original: lv }
} }
}) })
return { return {

View File

@ -21,12 +21,12 @@ export default class ProfileRank {
return false return false
} }
const key = this.key(profile, 'mark') const key = this.key(profile, 'mark')
let rank = await redis.zRank(key, this.uid) let rank = await redis.zRevRank(key, this.uid)
if (!lodash.isNumber(rank) || force) { if (!lodash.isNumber(rank) || force) {
let mark = profile.getArtisMark(false) let mark = profile.getArtisMark(false)
if (mark) { if (mark) {
await redis.zAdd(key, { score: mark._mark, value: this.uid }) await redis.zAdd(key, { score: mark._mark, value: this.uid })
rank = await redis.zRank(key, this.uid) rank = await redis.zRevRank(key, this.uid)
} }
} }
if (lodash.isNumber(rank)) { if (lodash.isNumber(rank)) {