diff --git a/core/chat/oauth/cache.go b/core/chat/oauth/cache.go index a9ce326d..f3f0971d 100644 --- a/core/chat/oauth/cache.go +++ b/core/chat/oauth/cache.go @@ -5,7 +5,7 @@ import "shylinux.com/x/ice" type cache struct { ice.Hash short string `data:"uniq"` - field string `data:"hash,state,client,goback"` + field string `data:"hash,state,goback"` } func init() { ice.Cmd("web.chat.oauth.cache", cache{}) } diff --git a/misc/wx/agent.go b/misc/wx/agent.go index 7be43265..6a9fa0be 100644 --- a/misc/wx/agent.go +++ b/misc/wx/agent.go @@ -53,6 +53,13 @@ func init() { )), Hand: func(m *ice.Message, arg ...string) { m.Cmdy(ACCESS, AGENT).Options(SIGNATURE, _wx_sign(m, m.Option(NONCESTR, ice.Info.Pathname), m.Option(TIMESTAMP, kit.Format(time.Now().Unix())))).Display("") ctx.OptionFromConfig(m, "oauth", nfs.SCRIPT) + if false && m.Option(ice.MSG_USERNAME) == "" { + msg := m.Spawn() + web.ParseURL(msg, m.Option("oauth")) + state := m.Cmdx("web.chat.oauth.cache", mdb.CREATE, "state", msg.Option("state"), "goback", m.Option(ice.MSG_USERWEB)) + what := kit.MergeURL(m.Option("oauth"), "state", state) + m.Info("what %v", what) + } m.Option("oauth", strings.ReplaceAll(m.Option("oauth"), "https%3A%2F%2Fyunxuanlinghang.com", strings.ReplaceAll(m.Option(ice.MSG_USERHOST), "://", "%3A%2F%2F"))) }}, })