diff --git a/base/web/web.go b/base/web/web.go index 8846214e..0d2cd813 100644 --- a/base/web/web.go +++ b/base/web/web.go @@ -2420,6 +2420,21 @@ var Index = &ice.Context{Name: "web", Help: "网络模块", } m.Render(ice.RENDER_DOWNLOAD, path.Join(prefix, repos, path.Join(arg[2:]...))) }}, + "/publish/": {Name: "/publish/", Help: "空间站", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + if p := m.Option("pod"); p != "" { + m.Option("pod", "") + m.Cmdy(ice.WEB_SPACE, p, "web./publish/", arg) + m.Render(ice.RENDER_RESULT) + return + } + + p := path.Join(kit.Simple(m.Conf(ice.WEB_SERVE, "meta.publish"), arg)...) + if m.W == nil { + m.Cmdy("nfs.cat", p) + return + } + m.Render(ice.RENDER_DOWNLOAD, p) + }}, "/local/": {Name: "/space/", Help: "空间站", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { p := path.Join(cmd) switch strings.TrimSuffix(path.Ext(p), ".") { @@ -2427,14 +2442,6 @@ var Index = &ice.Context{Name: "web", Help: "网络模块", m.Render(ice.RENDER_DOWNLOAD, p) } }}, - "/publish/": {Name: "/publish/", Help: "空间站", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { - if m.Option("pod") != "" { - m.Cmdy(ice.WEB_SPACE, m.Option("pod"), "web./publish", arg) - m.Render(ice.RENDER_RESULT) - return - } - m.Render(ice.RENDER_DOWNLOAD, path.Join(kit.Simple(m.Conf(ice.WEB_SERVE, "meta.publish"), arg)...)) - }}, }, } diff --git a/core/chat/chat.go b/core/chat/chat.go index c41193f8..5e4265bd 100644 --- a/core/chat/chat.go +++ b/core/chat/chat.go @@ -415,14 +415,24 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", "/target": {Name: "/target", Help: "对话框", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {}}, "/source": {Name: "/source", Help: "输入框", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {}}, "/action": {Name: "/action", Help: "工作台", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + // 代理命令 + proxy := []string{} + if m.Option("pod") != "" { + proxy = append(proxy, ice.WEB_PROXY, m.Option("pod")) + m.Option("pod", "") + } + if m.Warn(m.Option(ice.MSG_RIVER) == "" || m.Option(ice.MSG_STORM) == "", "not join") { + m.Set(ice.MSG_RESULT) + cmds := kit.Simple(kit.Keys(m.Option("group"), m.Option("index")), arg[3:]) if !m.Right(cmds) { m.Render("status", 403, "not auth") return } - m.Set(ice.MSG_RESULT) - m.Cmdy(cmds).Option("cmds", cmds) + + // 执行命令 + m.Cmdy(proxy, cmds).Option("cmds", cmds) return // m.Render("status", 402, "not join") } @@ -541,13 +551,6 @@ var Index = &ice.Context{Name: "chat", Help: "聊天中心", return } - // 代理命令 - proxy := []string{} - if m.Option("pod") != "" { - proxy = append(proxy, ice.WEB_PROXY, m.Option("pod")) - m.Option("pod", "") - } - // 执行命令 m.Cmdy(proxy, cmds).Option("cmds", cmds) }},