1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-07-08 19:45:05 +08:00
parent 01bacc73a2
commit af0d446abc
3 changed files with 17 additions and 0 deletions

View File

@ -210,6 +210,11 @@ func _serve_auth(m *ice.Message, key string, cmds []string, w http.ResponseWrite
return kit.Simple(m.Time(), m.OptionSplit(ice.MSG_USERNICK, ice.MSG_USERNAME, ice.MSG_USERROLE))
})); len(ls) > 0 {
aaa.SessAuth(m, kit.Dict(aaa.USERNICK, ls[1], aaa.USERNAME, ls[2], aaa.USERROLE, ls[3]), CACHE, ls[0])
} else {
msg := m.Cmd(SPIDE, aaa.USER, "msg", http.MethodPost, "/chat/header/action/info", ice.MSG_SESSID, m.Option(ice.MSG_SESSID))
if msg.Option(ice.MSG_USERNAME) != "" {
aaa.SessCheck(m, m.Option(ice.MSG_SESSID, aaa.SessCreate(m, msg.Option(ice.MSG_USERNAME))))
}
}
}
Count(m, aaa.IP, m.Option(ice.MSG_USERIP), m.Option(ice.MSG_USERUA))

View File

@ -15,6 +15,7 @@ import (
"time"
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/cli"
"shylinux.com/x/icebergs/base/ctx"
"shylinux.com/x/icebergs/base/log"
@ -201,6 +202,7 @@ func _spide_save(m *ice.Message, action, file, uri string, res *http.Response) {
case SPIDE_MSG:
var data map[string][]string
m.Assert(json.NewDecoder(res.Body).Decode(&data))
kit.For(data[ice.MSG_OPTION], func(k string) { m.Options(k, data[k]) })
kit.For(data[ice.MSG_APPEND], func(k string) { kit.For(data[k], func(v string) { m.Push(k, v) }) })
m.Resultv(data[ice.MSG_RESULT])
case SPIDE_SAVE:
@ -293,6 +295,7 @@ func init() {
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), ice.OPS, nfs.USR_ICONS_CONTEXTS, nfs.REPOS)
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:20000", conf[cli.CTX_DEMO]), ice.DEMO, nfs.USR_ICONS_VOLCANOS)
m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png")
m.Cmd("", mdb.CREATE, kit.Select("https://user.shylinux.com"), aaa.USER, "usr/icons/Mail.png")
}},
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
if mdb.IsSearchPreview(m, arg) {

View File

@ -1,6 +1,7 @@
package chat
import (
"net/http"
"path"
"strings"
"time"
@ -130,6 +131,14 @@ func init() {
m.Echo("login failure")
}
}},
ice.INFO: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {}},
aaa.USER: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
msg := m.Cmd(web.SPIDE, aaa.USER, "msg", http.MethodPost, "/chat/header/action/info", ice.MSG_SESSID, kit.Select(m.Option(ice.MSG_SESSID), arg, 0))
if msg.Option(ice.MSG_USERNAME) != "" {
aaa.SessCheck(m, m.Option(ice.MSG_SESSID, aaa.SessCreate(m, msg.Option(ice.MSG_USERNAME))))
m.Echo(m.Option(ice.MSG_SESSID))
}
}},
}, 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 ice.Info.NodeType == web.WORKER {
return