diff --git a/core/wiki/feel.go b/core/wiki/feel.go index bf7178db..8bf78a52 100644 --- a/core/wiki/feel.go +++ b/core/wiki/feel.go @@ -1,7 +1,11 @@ package wiki import ( + "os" + "strings" + ice "shylinux.com/x/icebergs" + "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" ) @@ -20,6 +24,10 @@ func init() { web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) { _wiki_upload(m, m.CommandKey(), m.Option(kit.MDB_PATH)) }}, + mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) { + os.Remove(strings.TrimPrefix(arg[0], "/share/local/")) + m.ProcessHold() + }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { _wiki_list(m, m.CommandKey(), kit.Select("./", arg, 0)) }},