From 35b06a3526ac60dc84899996d5e74cea6ee40b3c Mon Sep 17 00:00:00 2001 From: harveyshao Date: Sun, 17 Jul 2022 17:33:03 +0800 Subject: [PATCH] opt some --- core/chat/website.go | 4 ++-- option.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/chat/website.go b/core/chat/website.go index a1a47be6..ea3f5a73 100644 --- a/core/chat/website.go +++ b/core/chat/website.go @@ -241,7 +241,7 @@ func init() { }) }}, }, mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path,type,name,text")), Hand: func(m *ice.Message, arg ...string) { - mdb.HashSelect(m, arg...).Table(func(index int, value ice.Maps, head []string) { m.PushAnchor(m.MergeWebsite(value[nfs.PATH])) }) + mdb.HashSelect(m, arg...).Tables(func(value ice.Maps) { m.PushAnchor(m.MergeWebsite(value[nfs.PATH])) }) if len(arg) == 0 { // 文件列表 m.Cmd(nfs.DIR, SRC_WEBSITE, func(f os.FileInfo, p string) { @@ -259,7 +259,7 @@ func init() { m.PushAnchor(m.MergeLink(m.Append(nfs.PATH))) } - if m.FieldsIsDetail() { // 文件预览 + if len(arg) > 0 { // 文件预览 m.PushQRCode(mdb.SCAN, m.MergeURL2(m.Append(nfs.PATH))) m.EchoIFrame(m.Append(nfs.PATH)) } diff --git a/option.go b/option.go index 1310f1c9..a4103a62 100644 --- a/option.go +++ b/option.go @@ -294,13 +294,13 @@ func (m *Message) MergeCmd(cmd string, arg ...Any) string { cmd = m.PrefixKey() } if m.Option(MSG_USERPOD) == "" { - return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("/chat/cmd", cmd)) + return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("/chat", "cmd", cmd)) } - return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("cmd", cmd), arg...) + return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("/chat", "pod", m.Option(MSG_USERPOD), "cmd", cmd), arg...) } func (m *Message) MergeWebsite(web string, arg ...Any) string { if m.Option(MSG_USERPOD) == "" { - return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("/chat/website", web)) + return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("/chat", "website", web)) } - return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("website", web), arg...) + return kit.MergeURL2(kit.Select(Info.Domain, m.Option(MSG_USERWEB)), path.Join("/chat", "pod", m.Option(MSG_USERPOD), "website", web), arg...) }