mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt some
This commit is contained in:
parent
b16071324c
commit
2f6860b817
@ -19,7 +19,7 @@ import (
|
|||||||
|
|
||||||
func _share_link(m *ice.Message, p string, arg ...interface{}) string {
|
func _share_link(m *ice.Message, p string, arg ...interface{}) string {
|
||||||
p = kit.Select("", "/share/local/", !strings.HasPrefix(p, "/")) + p
|
p = kit.Select("", "/share/local/", !strings.HasPrefix(p, "/")) + p
|
||||||
return tcp.ReplaceLocalhost(m, kit.MergeURL2(m.Option(ice.MSG_USERWEB), p, arg...))
|
return tcp.ReplaceLocalhost(m, kit.MergeURL2(kit.Select(m.Conf(SHARE, kit.Keym("domain")), m.Option(ice.MSG_USERWEB)), p, arg...))
|
||||||
}
|
}
|
||||||
func _share_cache(m *ice.Message, arg ...string) {
|
func _share_cache(m *ice.Message, arg ...string) {
|
||||||
if pod := m.Option(cli.POD); m.PodCmd(CACHE, arg[0]) {
|
if pod := m.Option(cli.POD); m.PodCmd(CACHE, arg[0]) {
|
||||||
@ -130,8 +130,8 @@ func init() {
|
|||||||
m.Option(kit.MDB_LINK, _share_link(m, "/share/"+m.Result()))
|
m.Option(kit.MDB_LINK, _share_link(m, "/share/"+m.Result()))
|
||||||
}},
|
}},
|
||||||
LOGIN: {Name: "login userrole=void,tech username", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
LOGIN: {Name: "login userrole=void,tech username", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(SHARE, mdb.CREATE, kit.MDB_TYPE, LOGIN, m.OptionSimple(aaa.USERROLE, aaa.USERNAME))
|
msg := m.Cmd(SHARE, mdb.CREATE, kit.MDB_TYPE, LOGIN, m.OptionSimple(aaa.USERROLE, aaa.USERNAME))
|
||||||
m.EchoQRCode(m.Option(kit.MDB_LINK))
|
m.EchoQRCode(msg.Option(kit.MDB_LINK))
|
||||||
m.ProcessInner()
|
m.ProcessInner()
|
||||||
}},
|
}},
|
||||||
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, mdb.HashAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
@ -46,6 +46,9 @@ func (m *Message) OptionSplit(fields ...string) (res []string) {
|
|||||||
}
|
}
|
||||||
func (m *Message) OptionSimple(key ...string) (res []string) {
|
func (m *Message) OptionSimple(key ...string) (res []string) {
|
||||||
for _, k := range strings.Split(strings.Join(key, ","), ",") {
|
for _, k := range strings.Split(strings.Join(key, ","), ",") {
|
||||||
|
if k == "" || m.Option(k) == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
res = append(res, k, m.Option(k))
|
res = append(res, k, m.Option(k))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user