fix:修改配置模块

This commit is contained in:
Jerry 2025-09-29 16:39:33 +08:00
parent 1481eb024a
commit 1c0c71a405
3 changed files with 6 additions and 17 deletions

View File

@ -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+)$/);

View File

@ -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] 配置模块初始化成功..');

View File

@ -2,23 +2,12 @@ import ConfigControl from '../config/configControl.js';
import axios from 'axios';
const Meme = {
/**
* 获取随机表情
* @param character 角色名称
* @param status 角色状态
* @returns {Promise<axios.AxiosResponse<any>>}
*/
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}`;
},
};