diff --git a/core/chat/header.go b/core/chat/header.go index eedca3c7..e98e460c 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -140,6 +140,10 @@ func init() { } }}, }, web.ApiAction(), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,help,icons,order,link,space,index,args")), Hand: func(m *ice.Message, arg ...string) { + if m.Option(ice.MSG_USERNAME) == "" && m.Option("code") == "" && mdb.Config(m, "oauth") != "" { + m.ProcessOpen(mdb.Config(m, "oauth")) + return + } kit.If(m.Option(ice.MSG_USERPOD), func(p string) { m.Cmdy(web.SPACE, p, m.PrefixKey(), ice.Maps{ice.MSG_USERPOD: ""}) }, func() { diff --git a/misc/wx/access.go b/misc/wx/access.go index a6615be4..113ef890 100644 --- a/misc/wx/access.go +++ b/misc/wx/access.go @@ -110,6 +110,7 @@ func init() { m.OptionSimple("user_cmd", "sess_cmd"), ) m.Cmd(AGENT, OAUTH, m.Cmdx("web.chat.oauth.client", web.LINK, oauth)) + m.Cmd(web.SPACE, ice.OPS, ctx.CONFIG, "web.chat.header", OAUTH, m.Cmdx("web.chat.oauth.client", web.LINK, oauth)) }}, web.SSO: {Name: "sso name*=weixin help*=微信扫码 order=11 env=release,trial,develop wifi", Hand: func(m *ice.Message, arg ...string) { m.Cmd(web.CHAT_HEADER, mdb.CREATE, mdb.TYPE, mdb.PLUGIN, m.OptionSimple(mdb.NAME, mdb.HELP, mdb.ORDER), diff --git a/misc/wx/agent.go b/misc/wx/agent.go index d38594ac..af9ec604 100644 --- a/misc/wx/agent.go +++ b/misc/wx/agent.go @@ -40,6 +40,9 @@ func init() { Index.MergeCommands(ice.Commands{ AGENT: {Name: "agent auto", Help: "代理", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{ chat.HEADER_AGENT: {Hand: func(m *ice.Message, arg ...string) { + if m.Option(ice.MSG_USERNAME) == "" && mdb.Config(m, "oauth") != "" { + m.ProcessOpen(mdb.Config(m, "oauth")) + } kit.If(strings.Index(m.Option(ice.MSG_USERUA), "MicroMessenger") > -1, func() { m.Optionv(mdb.PLUGIN, m.PrefixKey(), mdb.Config(m, web.SPACE)) })