From 8cc28bdf2527f4172c02a2ec9f32316140cc8330 Mon Sep 17 00:00:00 2001 From: shylinux Date: Wed, 6 May 2020 13:11:33 +0800 Subject: [PATCH] opt some --- base/ctx/ctx.go | 2 +- core/chat/chat.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/base/ctx/ctx.go b/base/ctx/ctx.go index cfc96b5f..c6eb5e4b 100644 --- a/base/ctx/ctx.go +++ b/base/ctx/ctx.go @@ -214,8 +214,8 @@ var Index = &ice.Context{Name: "ctx", Help: "配置模块", } else { msg.Conf(arg[0], arg[1], kit.Parse(nil, "", arg[2:]...)) } - } + if len(arg) > 1 { // 读取配置 m.Echo(kit.Formats(msg.Confv(arg[0], arg[1]))) diff --git a/core/chat/chat.go b/core/chat/chat.go index 04d3181e..e904e127 100644 --- a/core/chat/chat.go +++ b/core/chat/chat.go @@ -407,7 +407,9 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", m.Echo(m.Conf(ice.WEB_SERVE, "meta.title")) }}, "/footer": {Name: "/footer", Help: "状态栏", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { - m.Echo(m.Conf(ice.WEB_SERVE, "meta.legal")) + kit.Fetch(m.Confv(ice.WEB_SERVE, "meta.legal"), func(index int, value string) { + m.Echo(value) + }) }}, "/target": {Name: "/target", Help: "对话框", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {}},