2024-08-02 18:41:34 +08:00

33 lines
1.0 KiB
Go

package gonganxitong
import (
"shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/aaa"
"shylinux.com/x/icebergs/base/web"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/community/src/gonganxitong/model"
)
type sess struct {
Table
user user
create string `name:"create user_uid"`
}
func (s sess) Create(m *ice.Message, arg ...string) {
s.Table.Create(m, model.USER_UID, m.Option(model.USER_UID), aaa.IP, m.Option(ice.MSG_USERIP), web.AGENT, m.Option(ice.MSG_USERUA))
m.ProcessCookie(ice.MSG_SESSID, kit.JoinWord(web.SPACE, m.Option(ice.MSG_USERPOD), m.PrefixKey(), aaa.CHECK, m.Result()), "-2")
}
func (s sess) Check(m *ice.Message, arg ...string) {
msg := s.Table.Select(m.Spawn(), model.UID, arg[0])
msg = m.Cmd(s.user, s.user.Select, model.UID, msg.Append(model.USER_UID))
m.Option(ice.MSG_USERROLE, aaa.VOID)
m.Option(ice.MSG_USERNAME, msg.Append(model.UID))
m.Option(ice.MSG_USERNICK, msg.Append(model.NAME))
m.Option(ice.MSG_AVATAR, msg.Append(model.AVATAR))
m.Option(model.USER_UID, msg.Append(model.UID))
}
func init() { ice.TeamCtxCmd(sess{}) }