This commit is contained in:
root 2024-10-12 11:10:20 +08:00
parent e7f7c9d07d
commit 5c395fbdbd
4 changed files with 10 additions and 8 deletions

View File

@ -61,6 +61,9 @@ func (s Table) Init(m *ice.Message, arg ...string) {
s.LoadTrans(m, arg...)
s.Table.Init(m, arg...)
}
func (s Table) AfterInit(m *ice.Message, arg ...string) {
m.Cmd("applications", mdb.REMOVE, kit.Hashs(","+m.PrefixKey()+","))
}
func (s Table) AfterMigrate(m *ice.Message, arg ...string) {
kit.If(m.GetCommand().Icon, func() { Portal{}.Show(m) })
}
@ -248,6 +251,7 @@ func (s Table) Update(m *ice.Message, data ice.Any, arg ...string) {
if len(arg) == 0 {
arg = append(arg, model.UID, kit.Select(m.Option(model.UID), m.Option(s.Keys(m.CommandKey(), model.UID))))
}
m.Info("what %v", data)
s.Table.Update(m, data, arg...)
}
func (s Table) UpdateAuth(m *ice.Message, arg ...string) {

View File

@ -22,15 +22,13 @@ type user struct {
}
func (s user) Create(m *ice.Message, arg ...string) {
if m.IsTech() {
m.OptionDefault(aaa.AVATAR, m.Option(ice.MSG_AVATAR), aaa.USERNICK, m.Option(ice.MSG_USERNICK))
}
if s.Table.Select(m, m.OptionSimple(model.OPEN_ID)...).Length() == 0 {
m.OptionDefault(aaa.AVATAR, m.Option(ice.MSG_AVATAR), aaa.USERNICK, m.Option(ice.MSG_USERNICK))
if msg := s.Table.Select(m.Spawn(), m.OptionSimple(model.OPEN_ID)...); msg.Length() == 0 {
s.Insert(m, kit.Simple(m.OptionSimple(model.OPEN_ID, model.AVATAR), model.NAME, m.Option(aaa.USERNICK))...)
m.Option(model.USER_UID, m.Result())
} else {
s.Update(m, kit.Dict(m.OptionSimple(model.AVATAR), model.NAME, m.Option(aaa.USERNICK)), m.AppendSimple(model.UID)...)
m.Option(model.USER_UID, m.Append(model.UID))
s.Update(m, kit.Dict(m.OptionSimple(model.AVATAR), model.NAME, m.Option(aaa.USERNICK)), msg.AppendSimple(model.UID)...)
m.Option(model.USER_UID, msg.Append(model.UID))
}
}
func (s user) Modify(m *ice.Message, arg ...string) {

View File

@ -10,5 +10,3 @@ import (
)
func main() { print(ice.Run()) }
func init() { ice.Info.Titles = "云社区" }

View File

@ -1 +1,3 @@
title "云社区"
field web.team.gonganxitong.portal