From 5260027c9f10cb1c2b3aaea75ff8c3b8f2272443 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 8 Mar 2025 08:38:13 +0800 Subject: [PATCH] add some --- base/web/dream.go | 2 +- core/code/go.go | 5 +++-- core/code/js.go | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/base/web/dream.go b/base/web/dream.go index 1dc95661..70baa7c4 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -376,7 +376,7 @@ func init() { GETTOKEN: {Help: "令牌", Style: html.DANGER, Hand: func(m *ice.Message, arg ...string) { m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()).Cmdy(SPIDE, mdb.DEV_REQUEST) }}, - GRANT: {Name: "grant username", Hand: func(m *ice.Message, arg ...string) { + GRANT: {Name: "grant username", Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) { if aaa.IsTechOrRoot(m) && m.Option(aaa.USERNAME) != "" { m.Option(ice.MSG_USERNAME, m.Option(aaa.USERNAME)) } diff --git a/core/code/go.go b/core/code/go.go index beda49ab..95058dd7 100644 --- a/core/code/go.go +++ b/core/code/go.go @@ -74,7 +74,7 @@ func _go_show(m *ice.Message, arg ...string) { // ctx.ProcessField(m, "web.code.xterm", kit.Simple()) ctx.ProcessField(m, "log.debug", kit.Simple("bench")) } else if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" { - if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); path.Base(arg[1]) != "portal.go" && nfs.Exists(m, p) && + if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); path.Base(arg[1]) != "portal.go" && !kit.IsIn(arg[1], "gonganxitong/user.go", "gonganxitong/sess.go", @@ -82,7 +82,8 @@ func _go_show(m *ice.Message, arg ...string) { "gonganxitong/domain.go", "gonganxitong/command.go", "gonganxitong/quotalist.go", - ) { + "operation/studio.go", + ) && nfs.Exists(m, p) { if cmd := ctx.GetFileCmd(p); cmd != "" { if m.ActionKey() == mdb.RENDER { ctx.ProcessField(m, cmd, kit.Simple()) diff --git a/core/code/js.go b/core/code/js.go index e0ef85c5..17059cb8 100644 --- a/core/code/js.go +++ b/core/code/js.go @@ -22,7 +22,9 @@ func _js_show(m *ice.Message, arg ...string) { ctx.ProcessField(m, kit.Select(ice.CAN_PLUGIN, "web."+strings.Replace(strings.TrimSuffix(strings.TrimPrefix(arg[1], "plugin/local/"), nfs.PT+JS), nfs.PS, nfs.PT, -1)), nil) } } else { - if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); nfs.Exists(m, p) { + if p := path.Join(arg[2], strings.Split(arg[1], "/")[0], "portal.go"); !kit.IsIn(arg[1], + "operation/studio.js", + ) && nfs.Exists(m, p) { if cmd := ctx.GetFileCmd(p); cmd != "" { ctx.ProcessField(m, cmd, kit.Simple()) return