修正proxy cons的问题

This commit is contained in:
Kokomi 2022-09-21 11:06:33 +08:00
parent bc51c4b1a1
commit 62c943f3c2
2 changed files with 3 additions and 7 deletions

View File

@ -200,7 +200,7 @@ async function abyssPct (e) {
async function abyssTeam (e) {
let mys = await MysApi.init(e, 'cookie')
if (!mys || !mys.uid) {
if (!mys || !mys.uid || !mys.isSelfCookie) {
return true
}
@ -210,12 +210,8 @@ async function abyssTeam (e) {
return true
}
abyssData = abyssData.data
let uid = e.selfUser.uid
let avatars
try {
if (!await AvatarList.hasTalentCache(uid)) {
e.reply('正在获取用户信息,请稍候...')
}
avatars = await AvatarList.getAll(e, mys)
// resDetail = await mys.getCharacter()
if (!avatars) {

View File

@ -40,7 +40,7 @@ export default class Avatar extends Base {
if (profile && profile.isProfile && profile.hasData) {
this.profile = profile
}
this.elem = ((profile && profile.elem) || data.element || data.elem || 'anemo').toLowerCase()
this.elem = ((profile && profile.elem) || data.element || data.elem || char.elem || 'anemo').toLowerCase()
if (char.isTraveler) {
this.char = Character.get({ id: data.id || char.id, elem: this.elem })
uid && char.setTraveler(uid)
@ -105,7 +105,7 @@ export default class Avatar extends Base {
get cons () {
let data = this.meta
let profile = this.profile
return data.cons || data.actived_constellation_num || profile.cons || 0
return data?.cons || data?.actived_constellation_num || profile?.cons || 0
}
get weapon () {