diff --git a/src/gonganxitong/portal.go b/src/gonganxitong/portal.go index c82fb22..db207a9 100644 --- a/src/gonganxitong/portal.go +++ b/src/gonganxitong/portal.go @@ -7,7 +7,9 @@ import ( "shylinux.com/x/icebergs/base/aaa" "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/mdb" + "shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/web" + "shylinux.com/x/icebergs/base/web/html" kit "shylinux.com/x/toolkits" "shylinux.com/x/community/src/api" @@ -45,7 +47,7 @@ func (s Portal) Exit(m *ice.Message, arg ...string) { func (s Portal) BeforeMigrate(m *ice.Message, arg ...string) { } func (s Portal) AfterMigrate(m *ice.Message, arg ...string) { - if name := kit.Select("", kit.Split(m.PrefixKey(), "."), -2); !m.Exists("src/" + name) { + if name := kit.Select("", kit.Split(m.PrefixKey(), "."), -2); !m.Exists(nfs.SRC + name) { return } cmd := m.GetCommand() @@ -70,9 +72,8 @@ func (s Portal) Command(m *ice.Message, arg ...string) { } } func (s Portal) Run(m *ice.Message, arg ...string) { - if m.Option("user.status") == "1" { - m.Option("display.style", "output") - m.Echo("用户已禁用") + if m.Option(ice.MSG_USERSTATUS) == "1" { + m.Echo("用户已禁用").Option("display.style", html.OUTPUT) return } if m.Option(model.MESSAGE_UID) != "" { @@ -86,8 +87,7 @@ func (s Portal) Run(m *ice.Message, arg ...string) { } s.DisplayBase(m, "common.js") defer func() { - if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.TO_USER_UID) == -1 && - kit.IndexOf(m.Appendv(ice.KEY), model.TO_USER_UID) == -1 { + if kit.IndexOf(m.Appendv(ice.MSG_APPEND), model.TO_USER_UID) == -1 && kit.IndexOf(m.Appendv(ice.KEY), model.TO_USER_UID) == -1 { m.Optionv(model.TO_USER_UID, []string{}) } }() @@ -119,11 +119,11 @@ func (s Portal) Run(m *ice.Message, arg ...string) { if s.UserPlaceRole(m); kit.IsIn(role, "", aaa.VOID, aaa.TECH, aaa.ROOT) { kit.If(!ctx.PodCmd(m.Message, arg) && aaa.Right(m.Message, arg), func() { m.Cmdy(arg) }) } else { - if kit.IsIn(role, "worker") { + if kit.IsIn(role, api.WORKER) { if !m.WarnNotRight(!s.IsWorker(m)) { m.Cmdy(arg) } - } else if kit.IsIn(role, "leader") { + } else if kit.IsIn(role, api.LEADER) { if !m.WarnNotRight(!s.IsLeader(m)) { m.Cmdy(arg) } @@ -140,9 +140,8 @@ func (s Portal) Run(m *ice.Message, arg ...string) { }) } func (s Portal) List(m *ice.Message, arg ...string) { - if m.Option("user.status") == "1" { - m.Option("display.style", "output") - m.Echo("用户已禁用") + if m.Option(ice.MSG_USERSTATUS) == "1" { + m.Echo("用户已禁用").Option("display.style", html.OUTPUT) return } m.OptionDefault(model.USER_UID, m.Option(ice.MSG_USERUID)) diff --git a/src/renzhengshouquan/profile.js b/src/renzhengshouquan/profile.js index b6c7790..525a634 100644 --- a/src/renzhengshouquan/profile.js +++ b/src/renzhengshouquan/profile.js @@ -65,8 +65,8 @@ Volcanos(chat.ONACTION, { can.onimport.myStory(can, {index: "web.team.renzhengshouquan.portal", args: [msg.Option(UID)]}) // can.user.open(can.misc.MergePodCmd(can, {pod: "20240724-community", cmd: "web.team.renzhengshouquan.admin", auth_uid: msg.Option("auth_uid"), view: "admin"})) } else if (msg.Option("auth_type") == "service") { - can.onimport.myStory(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]}) - // can.onimport.myPlugin(can, {space: msg.Option("nodename"), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]}) + can.onimport.myStory(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]}) + // can.onimport.myPlugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]}) } else { can.onimport.myStory(can, {index: "web.team.renzhengshouquan.portal", args: [msg.Option(UID)||msg.Option(AUTH_UID)]}) }