diff --git a/apps/gacha/Gacha.js b/apps/gacha/Gacha.js index a2a8d27e..3ea04e62 100644 --- a/apps/gacha/Gacha.js +++ b/apps/gacha/Gacha.js @@ -28,6 +28,10 @@ let Gacha = { } let gacha = GachaData.analyse(e.user_id, uid, type) + if (!gacha) { + e.reply('本地暂无抽卡信息') + return true + } await Common.render('gacha/gacha-detail', { save_id: uid, uid, @@ -53,6 +57,10 @@ let Gacha = { return false } let gacha = GachaData.stat(e.user_id, uid, type) + if (!gacha) { + e.reply('本地暂无抽卡信息') + return true + } await Common.render('gacha/gacha-stat', { save_id: uid, uid, @@ -64,7 +72,7 @@ let Gacha = { getFace (uid) { let player = Player.create(uid) - let faceChar = Character.get(player.face || '100000003') + let faceChar = Character.get(player.face || 10000014) let imgs = faceChar.imgs return { banner: imgs?.banner, diff --git a/apps/gacha/GachaData.js b/apps/gacha/GachaData.js index 541efaaa..8381879b 100644 --- a/apps/gacha/GachaData.js +++ b/apps/gacha/GachaData.js @@ -1,7 +1,7 @@ import lodash from 'lodash' import { Data } from '../../components/index.js' import { Character, Weapon } from '../../models/index.js' -import { poolName, poolDetail } from '../../resources/meta/info/index.js' +import { poolDetail } from '../../resources/meta/info/index.js' import moment from 'moment' let poolVersion = [] @@ -111,6 +111,9 @@ let GachaData = { let allNum = 0 let itemMap = logData.itemMap + if (logData.items.length === 0) { + return false + } lodash.forEach(logData.items, (item) => { allNum++ let ds = itemMap[item.id] @@ -242,7 +245,6 @@ let GachaData = { items = items.concat(gachaData.items) lodash.extend(itemMap, gachaData.itemMap || {}) } - console.log('gacha data', type) if (['up', 'char', 'all'].includes(type)) { loadData(301) } @@ -259,6 +261,10 @@ let GachaData = { let versionData = [] let currVersion + if (lodash.isEmpty(items)) { + return false + } + let getCurr = function () { if (currVersion && !lodash.isEmpty(currVersion)) { let cv = currVersion @@ -341,7 +347,6 @@ let GachaData = { v.version = type === 'all' ? '全部统计' : '常驻池' } if (!v) { - console.log('no v') return true } currVersion = {