1
0
mirror of https://shylinux.com/x/icebergs synced 2025-06-26 02:17:30 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-06-16 14:35:04 +08:00
parent fa884c8302
commit cd25b243c4
5 changed files with 10 additions and 5 deletions

View File

@ -190,6 +190,7 @@ func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.Response
kit.For(r.Cookies(), func(k, v string) { m.Optionv(k, v) })
m.Options(ice.MSG_METHOD, r.Method, ice.MSG_COUNT, "0")
m.Options(ice.MSG_REFERER, r.Header.Get(html.Referer))
m.Options(ice.MSG_USERURL, r.URL.String())
m.Options(ice.MSG_USERWEB, _serve_domain(m), ice.MSG_USERPOD, m.Option(ice.POD))
m.Options(ice.MSG_USERUA, r.Header.Get(html.UserAgent), ice.MSG_USERIP, r.Header.Get(ice.MSG_USERIP))
m.Options(ice.MSG_SESSID, kit.Select(m.Option(ice.MSG_SESSID), m.Option(CookieName(m.Option(ice.MSG_USERWEB)))))

View File

@ -222,6 +222,7 @@ const ( // MSG
MSG_USERIP = "user.ip"
MSG_USERUA = "user.ua"
MSG_USERURL = "user.url"
MSG_USERWEB = "user.web"
MSG_USERPOD = "user.pod"
MSG_USERPOD0 = "user.pod0"

View File

@ -158,6 +158,9 @@ func (s Client) Login(m *ice.Message, arg ...string) {
func (s Client) Login2(m *ice.Message, arg ...string) {
if state, code := m.Option(STATE), m.Option(CODE); !m.WarnNotValid(state == "" || code == "") {
msg := m.Spawn()
_msg := m.Cmd("web.chat.oauth.cache", state)
state = kit.Select(state, _msg.Append("state"))
m.Option("goback", _msg.Append("goback"))
s.Hash.List(msg, m.Option(mdb.HASH, state)).Table(func(value ice.Maps) { msg.Options(value) })
msg.Options(GRANT_TYPE, AUTHORIZATION_CODE, REDIRECT_URI, s.RedirectURI(msg)).Option(ACCESS_TOKEN, "")
if res := s.Get(msg, msg.Option(mdb.HASH), msg.Option(GRANT_URL), kit.Simple(msg.OptionSimple(GRANT_TYPE, CODE), "appid", msg.Option(CLIENT_ID), "secret", msg.Option(CLIENT_SECRET))...); !m.WarnNotValid(res == nil) {

View File

@ -29,7 +29,7 @@ func init() {
} else {
if msg := m.Cmd(web.SPACE, "20240724-community", "web.chat.oauth.client", "action", "login2"); msg.Option("_arg") != "" {
m.RenderResult(kit.Format(template(`document.cookie = "sessid=%s;path=/"; location.href = "%s"; document.cookie = "goback=;path=/;expires=Mon, 19 May 2025 00:52:51 GMT"`),
kit.Simple(msg.Optionv("_arg"))[1], m.Option("goback")))
kit.Simple(msg.Optionv("_arg"))[1], kit.Select("/s/20240724-enterprise/c/web.team.yingxiaotuiguang.portal", msg.Option("goback"), m.Option("goback"))))
return
}
}

View File

@ -53,12 +53,12 @@ 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) == "" {
if 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)
state := m.Cmdx("web.chat.oauth.cache", mdb.CREATE, "state", msg.Option("state"), "goback", kit.Select(m.Option(ice.MSG_USERURL), m.Option(ice.MSG_REFERER)))
oauth := kit.MergeURL(m.Option("oauth"), "state", state)
m.Option("oauth", oauth)
}
m.Option("oauth", strings.ReplaceAll(m.Option("oauth"), "https%3A%2F%2Fyunxuanlinghang.com", strings.ReplaceAll(m.Option(ice.MSG_USERHOST), "://", "%3A%2F%2F")))
}},