diff --git a/apps/profile/ProfileList.js b/apps/profile/ProfileList.js index 45bd486d..385ce968 100644 --- a/apps/profile/ProfileList.js +++ b/apps/profile/ProfileList.js @@ -51,8 +51,10 @@ const ProfileList = { async render (e) { let uid = await getTargetUid(e) if (!uid) { + e._replyNeedUid || e.reply('请先发送【#绑定+你的UID】来绑定查询目标') return true } + let isSelfUid = false if (e.runtime) { let uids = e.runtime?.user?.ckUids || [] diff --git a/apps/profile/ProfileRank.js b/apps/profile/ProfileRank.js index 842cffbc..e71b8b2c 100644 --- a/apps/profile/ProfileRank.js +++ b/apps/profile/ProfileRank.js @@ -1,4 +1,4 @@ -import { Character, ProfileRank, ProfileDmg, Player } from '../../models/index.js' +import { Character, ProfileRank, ProfileDmg, Player } from '#miao.models' import ProfileDetail from './ProfileDetail.js' import { Data, Common, Format } from '#miao' import lodash from 'lodash' @@ -202,7 +202,7 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) { if (uid) { let userInfo = await ProfileRank.getUidInfo(uid) if (userInfo && userInfo.qq) { - let member = e.group?.pickMember(userInfo.qq * 1) + let member = e.group?.pickMember(userInfo.qq) let img = member?.getAvatarUrl(140) if (img) { tmp.qqFace = img @@ -225,15 +225,13 @@ async function renderCharRankList ({ e, uids, char, mode, groupId }) { } let title if (char) { - if (mode === 'mark') { - title = `#${char.name}${'圣遗物评分'}排行` - } - if (mode === 'crit') { - title = `#${char.name}${'双爆副词条'}排行` - } - if (mode === 'valid') { - title = `#${char.name}${'加权有效词条'}排行` + let modeTitleMap = { + dmg: '', + mark: '圣遗物评分', + crit: '双爆副词条', + valid: '加权有效词条' } + title = `#${char.name}${modeTitleMap[mode]}排行` list = lodash.sortBy(list, mode === 'dmg' ? '_dmg' : '_mark').reverse() } else { title = `#${mode === 'mark' ? '最高分' : '最强'}排行` diff --git a/components/Cfg.js b/components/Cfg.js index df4b2091..a6573ef3 100644 --- a/components/Cfg.js +++ b/components/Cfg.js @@ -1,20 +1,31 @@ import fs from 'fs' import lodash from 'lodash' import cfgData from './cfg/CfgData.js' +import { Version } from '#miao' const _path = process.cwd() const _cfgPath = `${_path}/plugins/miao-plugin/components/` let cfg = {} +let miaoCfg = {} + try { cfg = await cfgData.getCfg() cfgData.saveCfg(cfg) + lodash.forEach(cfgData.getCfgSchemaMap(), (cm) => { + if (cm.miao) { + miaoCfg[cm.cfgKey] = true + } + }) } catch (e) { // do nth } let Cfg = { get (rote) { + if (Version.isMiao && miaoCfg[rote]) { + return true + } return lodash.get(cfg, rote) }, set (rote, val) { diff --git a/resources/admin/index.html b/resources/admin/index.html index 03415dea..21cfa456 100644 --- a/resources/admin/index.html +++ b/resources/admin/index.html @@ -18,7 +18,7 @@