From 279e997744ececcee3b34a4ae9bea026245a391c Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Sun, 25 Sep 2022 02:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Enka=E4=B8=8B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=9D=A2=E6=9D=BF=E6=97=B6=E7=9A=84=E5=9C=A3=E9=81=97?= =?UTF-8?q?=E7=89=A9=E8=A7=A3=E6=9E=90=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/avatar-card.js | 4 ++-- components/Common.js | 2 -- components/profile-data/enka-data.js | 8 +++----- models/Artifact.js | 10 +--------- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/apps/character/avatar-card.js b/apps/character/avatar-card.js index 0476662f..df0ff8c9 100644 --- a/apps/character/avatar-card.js +++ b/apps/character/avatar-card.js @@ -85,8 +85,8 @@ async function renderCard (e, ds, renderType = 'card') { data }, { e, scale, retMsgId: true }) if (msgRes && msgRes.message_id) { - // 如果消息发送成功,就将message_id和图片路径存起来,1小时过期 - await redis.set(`miao:original-picture:${msgRes.message_id}`, bg.img, { EX: 3600 }) + // 如果消息发送成功,就将message_id和图片路径存起来,3小时过期 + await redis.set(`miao:original-picture:${msgRes.message_id}`, bg.img, { EX: 3600 * 3 }) } return true } diff --git a/components/Common.js b/components/Common.js index d5c4970d..23ce2b0e 100644 --- a/components/Common.js +++ b/components/Common.js @@ -1,6 +1,4 @@ import Cfg from './Cfg.js' -import { Version } from './index.js' - import render from './common-lib/render.js' function sleep (ms) { diff --git a/components/profile-data/enka-data.js b/components/profile-data/enka-data.js index fb9d21ca..ce6f7e20 100644 --- a/components/profile-data/enka-data.js +++ b/components/profile-data/enka-data.js @@ -1,6 +1,6 @@ import lodash from 'lodash' import enkaMeta from './enka-meta.js' -import { Character, Artifact, ProfileData } from '../../models/index.js' +import { Character, ArtifactSet, ProfileData } from '../../models/index.js' const artiIdx = { EQUIP_BRACER: 1, @@ -126,11 +126,9 @@ let EnkaData = { if (!idx) { return } - let setName = enkaMeta[flat.setNameTextMapHash] || '' - - ret[`arti${idx}`] = { - name: Artifact.getArtiBySet(setName, idx), + ret[idx] = { + name: ArtifactSet.getArtiNameBySet(setName, idx), set: setName, level: Math.min(20, ((ds.reliquary && ds.reliquary.level) || 1) - 1), main: get(flat.reliquaryMainstat), diff --git a/models/Artifact.js b/models/Artifact.js index 4d534e48..4a507dc4 100644 --- a/models/Artifact.js +++ b/models/Artifact.js @@ -1,6 +1,6 @@ import Base from './Base.js' import { ArtifactSet } from './index.js' -import { abbr, artiMap, attrMap } from '../resources/meta/artifact/index.js' +import { artiMap, attrMap } from '../resources/meta/artifact/index.js' class Artifact extends Base { constructor (name) { @@ -52,12 +52,4 @@ class Artifact extends Base { } } -// 根据圣遗物名称获取套装 -// getSetByArti - -// 获取指定圣遗物套装指定位置的名字 -// getArtiBySet - -// getAbbrBySet -// getMeta export default Artifact