From 1c0c71a405acb8ed005638e364ec79a1fbe4bdaf Mon Sep 17 00:00:00 2001 From: Jerryplusy Date: Mon, 29 Sep 2025 16:39:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/login.js | 6 +++--- lib/config/configControl.js | 2 +- lib/core/meme.js | 15 ++------------- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/apps/login.js b/apps/login.js index a97c703..1d95e26 100644 --- a/apps/login.js +++ b/apps/login.js @@ -44,7 +44,7 @@ export default class LoginService extends plugin { let config = await configControl.get(); if (!config?.login?.allowGroups.includes(e.group_id)) { const img = await Meme.getMeme('zhenxun', 'default'); - return e.reply(segment.img(img)); //都不在群里玩什么;[ + return e.reply(segment.image(img)); //都不在群里玩什么;[ } const isAdmin = e.isMaster; const userId = e.user_id; @@ -118,7 +118,7 @@ export default class LoginService extends plugin { let config = await configControl.get()?.login; if (!e.isMaster) { const img = await Meme.getMeme('zhenxun', 'default'); - return e.reply(segment.img(img)); + return e.reply(segment.image(img)); } const match = e.msg.match(/^#绑定账号\s+(\d+)$/); if (!match) return; @@ -142,7 +142,7 @@ export default class LoginService extends plugin { async unbindAccount(e) { if (!e.isMaster) { const img = await Meme.getMeme('zhenxun', 'default'); - return e.reply(segment.img(img)); + return e.reply(segment.image(img)); } let config = await configControl.get()?.login; const match = e.msg.match(/^#解绑账号\s+(\d+)$/); diff --git a/lib/config/configControl.js b/lib/config/configControl.js index 85e0847..546f263 100644 --- a/lib/config/configControl.js +++ b/lib/config/configControl.js @@ -70,7 +70,7 @@ async function init() { } } if (!Array.isArray(configCache)) { - configCache = fc.mergeConfig(configCache, defaultConfig); + configCache = fc.mergeConfig(configCache, configCache.config || {}); } if (configCache.debug) { logger.info('[crystelf-admin] 配置模块初始化成功..'); diff --git a/lib/core/meme.js b/lib/core/meme.js index 8cb00b4..375c27c 100644 --- a/lib/core/meme.js +++ b/lib/core/meme.js @@ -2,23 +2,12 @@ import ConfigControl from '../config/configControl.js'; import axios from 'axios'; const Meme = { - /** - * 获取随机表情 - * @param character 角色名称 - * @param status 角色状态 - * @returns {Promise>} - */ async getMeme(character, status) { const coreConfig = await ConfigControl.get()?.coreConfig; const coreUrl = coreConfig?.coreUrl; const token = coreConfig?.token; - return await axios.get(`${coreUrl}/api/meme`, { - params: { - character: character, - status: status, - token: token, - }, - }); + //logger.info(`${coreUrl}/api/meme`); + return `${coreUrl}/api/meme?token=${token}?character=${character}&status=${status}`; }, };