diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0c4398..85140628 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,18 @@ -# 1.9.7 +# 1.9.8 + +* `#上传深渊`、`#面板练度统计`已知问题修复,功能优化 +* 对MiaoApi新版profile服务增加适配 + +# 1.9.1 ~ 1.9.7 * 新增`#面板练度统计`功能 * 可展示当前角色天赋及圣遗物练度信息 * 需要用户绑定Cookie,圣遗物评分需要本地获取并查看过对应角色面板 -* `#面板列表` 等页面样式与功能优化 -* 内嵌字体改为默认woff格式,调整部分页面与资源的结构与引用逻辑 - -# 1.9.1 ~ 1.9.6 - +* `#上传深渊`使用图片渲染深渊结果,同时可被`#喵喵深渊`触发 + * 可展示本期深渊的全部角色信息,包括组队、天赋及圣遗物 + * 数据会上传至胡桃Api进行伤害排名,并展示在页面内 + * 可在`#喵喵设置`中启用`#喵喵深渊`作为默认`#深渊`,默认关闭 + * 启用后不会覆盖`#上期深渊`以及`#深渊12层`具体楼层的命令 * `#面板`、`#更新面板`命令使用图片渲染结果 * Enka面板服务支持配置代理 **@永恒的小黑屋** * 如需配置可在**miao-plugin/config/profile.js**文件中配置 @@ -16,11 +21,6 @@ * 感谢Enka官方 **@Algoinde**的官方授权及UA校验 * 感谢 **@MiniGrayGay**提供的Enka服务中转,若面板更新失败可尝试在**miao-plugin/config/profile.js**文件中配置切换更新API * 更新面板增加单用户更新间隔控制,默认5分钟 -* `#上传深渊`使用图片渲染深渊结果,同时可被`#喵喵深渊`触发 - * 可展示本期深渊的全部角色信息,包括组队、天赋及圣遗物 - * 数据会上传至胡桃Api进行伤害排名,并展示在页面内 - * 可在`#喵喵设置`中启用`#喵喵深渊`作为默认`#深渊`,默认关闭 - * 启用后不会覆盖`#上期深渊`以及`#深渊12层`具体楼层的命令 * `#深渊出场率`、`#角色持有率` 增加样本数量展示,增加数据使用授权提示 * 修正部分V3Yunzai下的适配问题 * 部分角色的圣遗物评分增加充能的词条评分权重 diff --git a/apps/character/profile-common.js b/apps/character/profile-common.js index 67362581..6ebf1d7a 100644 --- a/apps/character/profile-common.js +++ b/apps/character/profile-common.js @@ -141,7 +141,7 @@ export async function autoGetProfile (e, uid, avatar, callback) { e.reply(`请确认${char.name}已展示在【游戏内】的角色展柜中,并打开了“显示角色详情”。然后请使用 #更新面板\n命令来获取${char.name}的面板详情`) } return { err: true } - } else if (!['enka', 'input2', 'miao', 'miao-pre'].includes(profile.dataSource)) { + } else if (!['enka', 'input2', 'miao'].includes(profile.dataSource)) { if (!await refresh()) { e.reply('由于数据格式升级,请重新获取面板信息后查看') } @@ -225,7 +225,7 @@ export async function getProfileAll (e) { let chars = [] lodash.forEach(profiles || [], (ds) => { - if (!['enka', 'input2', 'miao-pre', 'miao'].includes(ds.dataSource)) { + if (!['enka', 'input2', 'miao'].includes(ds.dataSource)) { return } ds.name && chars.push(ds.name) diff --git a/apps/character/profile-detail.js b/apps/character/profile-detail.js index 9b82aed0..84f29db7 100644 --- a/apps/character/profile-detail.js +++ b/apps/character/profile-detail.js @@ -41,7 +41,7 @@ export async function renderProfile (e, char, render, mode = 'profile', params = e.reply('由于数据Api变更,请重新获取面板信息后查看') } return true - } else if (!['enka', 'input2', 'miao', 'miao-pre'].includes(profile.dataSource)) { + } else if (!['enka', 'input2', 'miao'].includes(profile.dataSource)) { if (!await refresh()) { e.reply('由于数据格式升级,请重新获取面板信息后查看') } diff --git a/apps/character/profile-list.js b/apps/character/profile-list.js index 82d07b62..a6c5b0b3 100644 --- a/apps/character/profile-list.js +++ b/apps/character/profile-list.js @@ -22,7 +22,7 @@ export async function profileList (e, { render }) { newChar = e.newChar } lodash.forEach(profiles || [], (ds) => { - if (!['enka', 'input2', 'miao-pre', 'miao'].includes(ds.dataSource)) { + if (!['enka', 'input2', 'miao'].includes(ds.dataSource)) { return } let { id } = ds diff --git a/apps/stat.js b/apps/stat.js index 20df8e41..96c08c05 100644 --- a/apps/stat.js +++ b/apps/stat.js @@ -411,7 +411,7 @@ export async function uploadData (e, { render }) { }) if (!MysApi || !MysApi.isSelfCookie) { if (isMatch) { - e.reply(`请绑定ck后再使用${e.original_msg}`) + e.reply(`请绑定ck后再使用${e.original_msg || e.msg}`) } return false } @@ -420,7 +420,7 @@ export async function uploadData (e, { render }) { let resDetail, resAbyss, overview try { resAbyss = await MysApi.getSpiralAbyss(1) - overview = await HutaoApi.getOverview() + // overview = await HutaoApi.getOverview() if (resAbyss.floors.length > 0 && !await Avatars.hasTalentCache(uid)) { e.reply('正在获取用户信息,请稍候...') } @@ -447,14 +447,19 @@ export async function uploadData (e, { render }) { return true } let abyss = new Abyss(resAbyss) + let abyssData = abyss.getData() let avatars = new Avatars(uid, resDetail.avatars) let avatarIds = abyss.getAvatars() + let overview = ret.info || (await HutaoApi.getOverview())?.data || {} let addMsg = function (title, ds) { let tmp = {} - if (!ds && !ds.avatarId && !ds.percent) { + if (!ds) { return } - let char = Character.get(ds.avatarId) + if (!ds.avatarId && !ds.id) { + return + } + let char = Character.get(ds.avatarId || ds.id) tmp.title = title tmp.id = char.id tmp.value = `${(ds.value / 10000).toFixed(1)} W` @@ -475,19 +480,25 @@ export async function uploadData (e, { render }) { }) } } - pct(ds.percent, char.name) - pct(ds.percentTotal, '总记录') + if (ds.percent) { + pct(ds.percent, char.name) + pct(ds.percentTotal, '总记录') + } else { + msg.push({ + txt: '暂无统计信息' + }) + } stat.push(tmp) } - addMsg('最强一击', ret.data.damage || {}) - addMsg('最高承伤', ret.data.takeDamage || {}) + addMsg('最强一击', ret.data?.damage || abyssData?.stat?.dmg || {}) + addMsg('最高承伤', ret.data?.takeDamage || abyssData?.stat.takeDmg || {}) let avatarData = await avatars.getTalentData(avatarIds, MysApi) return await Common.render('stat/abyss-summary', { - abyss: abyss.getData(), + abyss: abyssData, avatars: avatarData, stat, save_id: uid, - totalCount: overview?.data?.collectedPlayerCount || 0, + totalCount: overview?.collectedPlayerCount || 0, uid }, { e, render, scale: 1.8 }) } else { diff --git a/components/profile-data/miao.js b/components/profile-data/miao.js index 0efa34b9..89bf7a9e 100644 --- a/components/profile-data/miao.js +++ b/components/profile-data/miao.js @@ -20,11 +20,11 @@ let Miao = { e.reply(data.msg || '请求失败') return false } - if (!data.uidListData || data.uidListData.length === 0) { + data = data.data + if (!data.showAvatarInfoList || data.showAvatarInfoList.length === 0) { e.reply('请打开游戏内角色展柜的“显示详情”后,等待5分钟重新获取面板') return false } - return Miao.getData(uid, data) }, @@ -36,56 +36,35 @@ let Miao = { lodash.forEach({ name: 'nickname', - // avatar: "profilePicture.avatarId", - lv: 'level' + avatar: 'profilePicture.avatarID', + lv: 'level', + signature: 'signature' }, (src, key) => { ret[key] = lodash.get(data, src, '') }) - lodash.forEach(data.uidListData, (ds) => { - let char = Miao.getAvatar(ds) + lodash.forEach(data.showAvatarInfoList, (ds) => { + let char = Miao.getAvatarDetail(ds) ret.chars[char.id] = char }) + if (data.cacheExpireAt) { + let exp = Math.max(0, Math.round(data.cacheExpireAt - (new Date() / 1000))) + ret.ttl = Math.max(60, exp) + } return ret }, getAvatar (ds) { - let char = Character.get(ds.usernameid) + let char = Character.get(ds.id) let now = moment() return { - id: ds.usernameid, + id: ds.id, name: char ? char.name : '', - dataSource: 'miao-pre', + dataSource: 'miao', updateTime: now.format('YYYY-MM-DD HH:mm:ss'), lv: ds.level } }, - - async getCharData (uid, ds, saveCharData, { diyCfg = {}, sysCfg = {} }) { - if (ds.dataSource !== 'miao-pre' || !ds.id) { - return ds - } - try { - let url = diyCfg?.miaoApi?.url || sysCfg.miaoApi.url - let token = diyCfg?.miaoApi?.token || sysCfg.miaoApi.token - let profileApi = diyCfg?.miaoApi?.detailApi || sysCfg.miaoApi.detailApi - let api = profileApi({ url, token, uid, avatar: ds.id }) - let req = await fetch(api) - let data = await req.json() - if (data.status === 0 && data.uidData) { - data = Miao.getAvatarDetail(data) - if (data) { - saveCharData(uid, data) - return data - } - } - return ds - } catch (err) { - console.log(err) - return ds - } - }, - getAvatarDetail (data) { - let ds = data.uidData + getAvatarDetail (ds) { let char = Character.get(ds.id) let now = moment() let ret = { @@ -95,10 +74,10 @@ let Miao = { updateTime: now.format('YYYY-MM-DD HH:mm:ss'), lv: ds.level, fetter: ds.fetterLevel, - attr: Miao.getAttr(data.uidDataCombatValue), + attr: Miao.getAttr(ds.combatValue), weapon: Miao.getWeapon(ds.weapon), - artis: Miao.getArtifact(data.uidDataByReliquary), - cons: ds.constellationNum || 0, + artis: Miao.getArtifact(ds.reliquary), + cons: ds.promoteLevel || 0, talent: Miao.getTalent(char.id, ds.skill), _priority: 10 } @@ -207,13 +186,11 @@ let Miao = { idxMap[id] = nRet && nRet[1] ? idxMap[nRet[1]] : idxMap[idx] idx++ }) - let ret = {} lodash.forEach(data, (ds) => { let key = idxMap[ds.id] ret[key] = { - level_original: ds.level, - level_current: ds.level + level: ds.level } }) return ret @@ -229,9 +206,8 @@ let Miao = { id = id * 1 if (id !== 10000033) { let a = talent.a || {} - if (a.level_current > 10) { - a.level_current = 10 - a.level_original = 10 + if (a.level > 10) { + a.level = 10 } } ret._fix = true diff --git a/config/system/profile.js b/config/system/profile.js index bbbda18e..070b2070 100644 --- a/config/system/profile.js +++ b/config/system/profile.js @@ -15,10 +15,7 @@ export const miaoApi = { url: 'http://49.232.91.210/profile', token: 'miao-token', listApi: ({ url, uid, token }) => { - return `${url}/list?uid=${uid}&token=${token}` - }, - detailApi: ({ url, uid, avatar, token }) => { - return `${url}/detail?uid=${uid}&avatar=${avatar}&token=${token}` + return `${url}/data?uid=${uid}&token=${token}` } } diff --git a/resources/admin/index.html b/resources/admin/index.html index 41816ade..22c2803c 100644 --- a/resources/admin/index.html +++ b/resources/admin/index.html @@ -6,8 +6,8 @@
-
#喵喵设置
-
喵喵管理面板
+
喵喵管理面板
+
#喵喵设置
diff --git a/resources/admin/profile.html b/resources/admin/profile.html index e965a6dc..08c77271 100644 --- a/resources/admin/profile.html +++ b/resources/admin/profile.html @@ -10,8 +10,8 @@
-
#喵喵面板设置
-
角色面板管理
+
角色面板管理
+
#喵喵面板设置
diff --git a/resources/character/profile-stat.html b/resources/character/profile-stat.html index 6e73ae4f..c5c799e9 100644 --- a/resources/character/profile-stat.html +++ b/resources/character/profile-stat.html @@ -67,7 +67,7 @@ {{/if}}
-
+
{{each avatar?.artisMark?.sets || avatar?.sets || [] name}} + {{if avatar}}
{{ds.title}} {{ds.value}} @@ -45,9 +46,14 @@ style="background-image:url({{_res_path}}/meta/character/{{avatar.name}}/gacha_card.png)">
{{each ds.msg msg}} + {{if msg.txt}} +
{{msg.txt}}
+ {{else}}
{{msg.title}}{{msg.value}}%的{{msg.name}}
+ {{/if}} {{/each}}
+ {{/if}}
{{/each}}
@@ -110,7 +116,7 @@
  • #上传深渊会上传你的角色列表及当期深渊挑战数据,不会上传其他信息,感谢支持,喵~
  • 统计服务由SG团队胡桃API提供,上传的数据将会用于排名以及#深渊使用率#角色持有率等统计
  • 深渊排行为本期深渊排行,{{if totalCount}}本期已提交用户数:{{totalCount}},{{/if}}更新时间{{abyss.time}}。
  • -
  • 排名会随时间而更新,数据排名仅供娱乐~
  • +
  • 角色装备与圣遗物为当前最新状态;排名会随时间而更新,数据排名仅供娱乐~
  • diff --git a/resources/stat/abyss-summary.less b/resources/stat/abyss-summary.less index 31673701..b06c02e4 100644 --- a/resources/stat/abyss-summary.less +++ b/resources/stat/abyss-summary.less @@ -82,12 +82,11 @@ body, .container { .avatar-banner { - margin-top: -20px; - height: 270px; + height: 250px; width: 175px; background-repeat: no-repeat; background-size: 100% auto; - background-position: top center; + background-position: 0 -30px; } .abyss-data { @@ -268,18 +267,42 @@ body, .container { .avatar-banner { &.avatar-枫原万叶 { - background-position: 0 60px; + background-position: 0 40px; } &.avatar-九条裟罗 { - background-position: 0 30px; + background-position: 0 0; } &.avatar-香菱 { - background-position: 0 80px; + background-position: 0 50px; } &.avatar-行秋 { - background-position: 0 70px; + background-position: 0 50px; + } + + &.avatar-甘雨 { + background-position: 0 25px; + } + + &.avatar-刻晴 { + background-position: 0 15px; + } + + &.avatar-神里绫华 { + background-position: 0 -40px; + } + + &.avatar-班尼特 { + background-position: 0 -45px; + } + + &.avatar-五郎 { + background-position: 0 -45px; + } + + &.avatar-托马 { + background-position: 0 15px; } } \ No newline at end of file