mirror of
https://shylinux.com/x/community
synced 2025-07-01 21:21:19 +08:00
add some
This commit is contained in:
parent
adb11e18ac
commit
85c63e627c
@ -7,7 +7,9 @@ import (
|
|||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
|
"shylinux.com/x/icebergs/base/nfs"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
"shylinux.com/x/community/src/api"
|
"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) BeforeMigrate(m *ice.Message, arg ...string) {
|
||||||
}
|
}
|
||||||
func (s Portal) AfterMigrate(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
|
return
|
||||||
}
|
}
|
||||||
cmd := m.GetCommand()
|
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) {
|
func (s Portal) Run(m *ice.Message, arg ...string) {
|
||||||
if m.Option("user.status") == "1" {
|
if m.Option(ice.MSG_USERSTATUS) == "1" {
|
||||||
m.Option("display.style", "output")
|
m.Echo("用户已禁用").Option("display.style", html.OUTPUT)
|
||||||
m.Echo("用户已禁用")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if m.Option(model.MESSAGE_UID) != "" {
|
if m.Option(model.MESSAGE_UID) != "" {
|
||||||
@ -86,8 +87,7 @@ func (s Portal) Run(m *ice.Message, arg ...string) {
|
|||||||
}
|
}
|
||||||
s.DisplayBase(m, "common.js")
|
s.DisplayBase(m, "common.js")
|
||||||
defer func() {
|
defer func() {
|
||||||
if kit.IndexOf(m.Appendv(ice.MSG_APPEND), 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 {
|
||||||
kit.IndexOf(m.Appendv(ice.KEY), model.TO_USER_UID) == -1 {
|
|
||||||
m.Optionv(model.TO_USER_UID, []string{})
|
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) {
|
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) })
|
kit.If(!ctx.PodCmd(m.Message, arg) && aaa.Right(m.Message, arg), func() { m.Cmdy(arg) })
|
||||||
} else {
|
} else {
|
||||||
if kit.IsIn(role, "worker") {
|
if kit.IsIn(role, api.WORKER) {
|
||||||
if !m.WarnNotRight(!s.IsWorker(m)) {
|
if !m.WarnNotRight(!s.IsWorker(m)) {
|
||||||
m.Cmdy(arg)
|
m.Cmdy(arg)
|
||||||
}
|
}
|
||||||
} else if kit.IsIn(role, "leader") {
|
} else if kit.IsIn(role, api.LEADER) {
|
||||||
if !m.WarnNotRight(!s.IsLeader(m)) {
|
if !m.WarnNotRight(!s.IsLeader(m)) {
|
||||||
m.Cmdy(arg)
|
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) {
|
func (s Portal) List(m *ice.Message, arg ...string) {
|
||||||
if m.Option("user.status") == "1" {
|
if m.Option(ice.MSG_USERSTATUS) == "1" {
|
||||||
m.Option("display.style", "output")
|
m.Echo("用户已禁用").Option("display.style", html.OUTPUT)
|
||||||
m.Echo("用户已禁用")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.OptionDefault(model.USER_UID, m.Option(ice.MSG_USERUID))
|
m.OptionDefault(model.USER_UID, m.Option(ice.MSG_USERUID))
|
||||||
|
@ -65,8 +65,8 @@ Volcanos(chat.ONACTION, {
|
|||||||
can.onimport.myStory(can, {index: "web.team.renzhengshouquan.portal", args: [msg.Option(UID)]})
|
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"}))
|
// 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") {
|
} 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.myStory(can, {space: msg.Option(web.SPACE), 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.myPlugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX), args: [msg.Option(PLACE_UID)]})
|
||||||
} else {
|
} else {
|
||||||
can.onimport.myStory(can, {index: "web.team.renzhengshouquan.portal", args: [msg.Option(UID)||msg.Option(AUTH_UID)]})
|
can.onimport.myStory(can, {index: "web.team.renzhengshouquan.portal", args: [msg.Option(UID)||msg.Option(AUTH_UID)]})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user