From 0eac777f6fcdceaf7d2f3ee95848b67e69a22d36 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 14 Sep 2024 00:36:42 +0800 Subject: [PATCH] add some --- base/web/render.go | 11 +++++------ core/chat/header.go | 6 +++--- init.go | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/base/web/render.go b/base/web/render.go index bd0d3855..c23bf2ec 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -174,12 +174,11 @@ func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) { func RenderCmd(m *ice.Message, cmd string, arg ...ice.Any) { RenderPodCmd(m, "", cmd, arg...) } func RenderVersion(m *ice.Message) string { - if ice.Info.Make.Hash == "" { - return "" - } - ls := []string{ice.Info.Make.Version, ice.Info.Make.Forword, ice.Info.Make.Hash[:6]} - if m.Option(log.DEBUG) == ice.TRUE || m.R != nil && strings.Contains(m.R.URL.RawQuery, "debug=true") { - ls = append(ls, kit.Format("%d", time.Now().Unix()-kit.Time(ice.Info.Make.When)/int64(time.Second))) + ls := []string{ice.Info.Make.Versions()} + if strings.Contains(ice.Info.Make.Domain, "debug=true") { + if m.Option(log.DEBUG) == ice.TRUE || m.R != nil && strings.Contains(m.R.URL.RawQuery, "debug=true") { + ls = append(ls, kit.Format("%d", time.Now().Unix()-kit.Time(ice.Info.Make.When)/int64(time.Second))) + } } return "?" + kit.JoinQuery(kit.Simple(kit.Dict("_v", strings.Join(ls, "-"), ice.POD, m.Option(ice.MSG_USERPOD)))...) } diff --git a/core/chat/header.go b/core/chat/header.go index 6c36c18c..2d053afb 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -143,11 +143,11 @@ func init() { if kit.Contains(m.Option(ice.MSG_USERUA), "MicroMessenger") { if m.Option(ice.MSG_USERNAME) == "" && m.Option("code") == "" && mdb.Config(m, "oauth") != "" { m.ProcessOpen(mdb.Config(m, "oauth")) - return + // return } } - kit.If(m.Option(ice.MSG_USERPOD), func(p string) { - m.Cmdy(web.SPACE, p, m.PrefixKey(), ice.Maps{ice.MSG_USERPOD: ""}) + kit.If(kit.Select(m.Option(ice.POD), m.Option(ice.MSG_USERPOD)), func(p string) { + m.Cmdy(web.SPACE, p, m.PrefixKey(), ice.Maps{ice.MSG_USERPOD: "", ice.POD: ""}) }, func() { m.Option(ice.MSG_NODETYPE, ice.Info.NodeType) m.Option(ice.MSG_NODENAME, ice.Info.NodeName) diff --git a/init.go b/init.go index 5e5a4b68..1ba438d6 100644 --- a/init.go +++ b/init.go @@ -64,7 +64,7 @@ var Index = &Context{Name: ICE, Help: "冰山模块", Commands: Commands{ m.Cmd(EXPORT, IMPORT) m.Cmd(SOURCE, ETC_INIT_SHY) loadImportant(m) - // m.Cmd(CTX_OPEN) + m.Cmd(CTX_OPEN) }}, QUIT: {Hand: func(m *Message, arg ...string) { m.GoSleep300ms(func() { os.Exit(kit.Int(kit.Select("0", arg, 0))) })