diff --git a/base/tcp/tcp.go b/base/tcp/tcp.go index a29d3691..06c438d1 100644 --- a/base/tcp/tcp.go +++ b/base/tcp/tcp.go @@ -84,11 +84,17 @@ var Index = &ice.Context{Name: "tcp", Help: "通信模块", )}, }, Commands: map[string]*ice.Command{ - ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Load() }}, + ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + m.Load() + m.Cmd(IP).Table(func(index int, value map[string]string, head []string) { + m.Cmd(IP, aaa.White, value[IP]) + }) + + }}, ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save(PORT) }}, IP: {Name: "ip", Help: "地址", Action: map[string]*ice.Action{ - "white": {Name: "show ip", Help: "白名单", Hand: func(m *ice.Message, arg ...string) { + aaa.White: {Name: "show ip", Help: "白名单", Hand: func(m *ice.Message, arg ...string) { m.Rich(IP, kit.Keys("meta.white"), kit.Dict( kit.MDB_NAME, "", kit.MDB_TEXT, arg[0], diff --git a/base/web/web.go b/base/web/web.go index 8ebfab1e..825ec737 100644 --- a/base/web/web.go +++ b/base/web/web.go @@ -2,6 +2,7 @@ package web import ( ice "github.com/shylinux/icebergs" + "github.com/shylinux/icebergs/base/aaa" "github.com/shylinux/icebergs/base/cli" "github.com/shylinux/icebergs/base/gdb" "github.com/shylinux/icebergs/base/mdb" @@ -104,6 +105,7 @@ var Index = &ice.Context{Name: "web", Help: "网络模块", m.Cmd(SPIDE, mdb.CREATE, "self", kit.Select("http://:9020", m.Conf(cli.RUNTIME, "conf.ctx_self"))) m.Cmd(SPIDE, mdb.CREATE, "dev", kit.Select("http://:9020", m.Conf(cli.RUNTIME, "conf.ctx_dev"))) m.Cmd(SPIDE, mdb.CREATE, "shy", kit.Select("https://shylinux.com:443", m.Conf(cli.RUNTIME, "conf.ctx_shy"))) + m.Cmd(aaa.ROLE, aaa.White, aaa.VOID, "web", "/publish/") m.Cmd("mdb.search", "create", "favor", "favor", "web")