mirror of
https://shylinux.com/x/icebergs
synced 2025-04-25 17:18:05 +08:00
opt some
This commit is contained in:
parent
cdaa2d7984
commit
87c96c880d
@ -274,11 +274,13 @@ const SERVE = "serve"
|
|||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{P(ice.EXIT): {Hand: func(m *ice.Message, arg ...string) { m.Cmd(ice.EXIT) }},
|
Index.MergeCommands(ice.Commands{P(ice.EXIT): {Hand: func(m *ice.Message, arg ...string) { m.Cmd(ice.EXIT) }},
|
||||||
SERVE: {Name: "serve port auto main host system", Help: "服务器", Actions: ice.MergeActions(ice.Actions{
|
SERVE: {Name: "serve port auto main host system", Help: "服务器", Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.MAIN: {Name: "main index", Help: "首页", Hand: func(m *ice.Message, arg ...string) {
|
ice.MAIN: {Name: "main index space", Help: "首页", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Option(ctx.INDEX) == "" {
|
if m.Option(ctx.INDEX) == "" {
|
||||||
mdb.Config(m, ice.MAIN, "")
|
mdb.Config(m, ice.MAIN, "")
|
||||||
} else {
|
} else if m.Option(SPACE) == "" {
|
||||||
mdb.Config(m, ice.MAIN, C(m.Option(ctx.INDEX)))
|
mdb.Config(m, ice.MAIN, C(m.Option(ctx.INDEX)))
|
||||||
|
} else {
|
||||||
|
mdb.Config(m, ice.MAIN, S(m.Option(SPACE))+C(m.Option(ctx.INDEX)))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
mdb.ICONS: {Hand: func(m *ice.Message, arg ...string) { mdb.Config(m, mdb.ICONS, arg[0]) }},
|
mdb.ICONS: {Hand: func(m *ice.Message, arg ...string) { mdb.Config(m, mdb.ICONS, arg[0]) }},
|
||||||
|
@ -194,5 +194,7 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
func AddHeaderLogin(m *ice.Message, types, name, help, order string, arg ...string) {
|
func AddHeaderLogin(m *ice.Message, types, name, help, order string, arg ...string) {
|
||||||
m.Cmd(web.CHAT_HEADER, mdb.CREATE, mdb.TYPE, types, mdb.NAME, name, mdb.HELP, help, mdb.ORDER, order, arg)
|
m.Cmd(web.SPACE, ice.OPS, web.CHAT_HEADER, mdb.CREATE, mdb.TYPE, types, mdb.NAME, name, mdb.HELP, help, mdb.ORDER, order,
|
||||||
|
web.SPACE, m.Option(ice.MSG_USERPOD), ctx.INDEX, m.PrefixKey(), arg,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,8 @@ func _go_show(m *ice.Message, arg ...string) {
|
|||||||
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" && nfs.Exists(m, p) &&
|
||||||
!kit.IsIn(arg[1],
|
!kit.IsIn(arg[1],
|
||||||
"gonganxitong/user.go",
|
"gonganxitong/user.go",
|
||||||
|
"gonganxitong/sess.go",
|
||||||
|
"gonganxitong/grant.go",
|
||||||
"gonganxitong/domain.go",
|
"gonganxitong/domain.go",
|
||||||
"gonganxitong/command.go",
|
"gonganxitong/command.go",
|
||||||
"gonganxitong/quotalist.go",
|
"gonganxitong/quotalist.go",
|
||||||
|
@ -12,7 +12,6 @@ import (
|
|||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/nfs"
|
"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"
|
|
||||||
"shylinux.com/x/icebergs/core/chat"
|
"shylinux.com/x/icebergs/core/chat"
|
||||||
"shylinux.com/x/icebergs/core/chat/location"
|
"shylinux.com/x/icebergs/core/chat/location"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
@ -21,7 +20,6 @@ import (
|
|||||||
func _wx_sign(m *ice.Message, nonce, stamp string) string {
|
func _wx_sign(m *ice.Message, nonce, stamp string) string {
|
||||||
return kit.Format(sha1.Sum([]byte(kit.Join(kit.Sort(kit.Simple(
|
return kit.Format(sha1.Sum([]byte(kit.Join(kit.Sort(kit.Simple(
|
||||||
kit.Format("jsapi_ticket=%s", m.Cmdx(ACCESS, TICKET)),
|
kit.Format("jsapi_ticket=%s", m.Cmdx(ACCESS, TICKET)),
|
||||||
// kit.Format("url=%s", m.R.Header.Get(html.Referer)),
|
|
||||||
kit.Format("url=%s", m.Option(ice.MSG_REFERER)),
|
kit.Format("url=%s", m.Option(ice.MSG_REFERER)),
|
||||||
kit.Format("timestamp=%s", stamp),
|
kit.Format("timestamp=%s", stamp),
|
||||||
kit.Format("noncestr=%s", nonce),
|
kit.Format("noncestr=%s", nonce),
|
||||||
@ -47,17 +45,15 @@ func init() {
|
|||||||
m.Optionv(mdb.PLUGIN, m.PrefixKey(), mdb.Config(m, web.SPACE))
|
m.Optionv(mdb.PLUGIN, m.PrefixKey(), mdb.Config(m, web.SPACE))
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
"getLocation": {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(location.LOCATION, mdb.CREATE, arg) }},
|
|
||||||
"scanQRCode1": {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(chat.FAVOR, mdb.CREATE, arg) }},
|
|
||||||
"oauth": {Hand: func(m *ice.Message, arg ...string) { mdb.Config(m, "oauth", arg[0]) }},
|
"oauth": {Hand: func(m *ice.Message, arg ...string) { mdb.Config(m, "oauth", arg[0]) }},
|
||||||
|
"scanQRCode1": {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(chat.FAVOR, mdb.CREATE, arg) }},
|
||||||
|
"getLocation": {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(location.LOCATION, mdb.CREATE, arg) }},
|
||||||
}, gdb.EventsAction(chat.HEADER_AGENT), ctx.ConfAction(
|
}, gdb.EventsAction(chat.HEADER_AGENT), ctx.ConfAction(
|
||||||
"space", "", "oauth", "", nfs.SCRIPT, "https://res.wx.qq.com/open/js/jweixin-1.6.0.js",
|
"oauth", "", web.SPACE, "", nfs.SCRIPT, "https://res.wx.qq.com/open/js/jweixin-1.6.0.js",
|
||||||
)), Hand: func(m *ice.Message, arg ...string) {
|
)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(ACCESS, AGENT).Options(SIGNATURE, _wx_sign(m, m.Option(NONCESTR, ice.Info.Pathname), m.Option(TIMESTAMP, kit.Format(time.Now().Unix())))).Display("")
|
m.Cmdy(ACCESS, AGENT).Options(SIGNATURE, _wx_sign(m, m.Option(NONCESTR, ice.Info.Pathname), m.Option(TIMESTAMP, kit.Format(time.Now().Unix())))).Display("")
|
||||||
ctx.OptionFromConfig(m, nfs.SCRIPT, "oauth")
|
ctx.OptionFromConfig(m, "oauth", nfs.SCRIPT)
|
||||||
m.Option("oauth", strings.ReplaceAll(m.Option("oauth"),
|
m.Option("oauth", strings.ReplaceAll(m.Option("oauth"), "https%3A%2F%2Fyunxuanlinghang.com", strings.ReplaceAll(m.Option(ice.MSG_USERHOST), "://", "%3A%2F%2F")))
|
||||||
"https%3A%2F%2Fyunxuanlinghang.com", strings.ReplaceAll(m.Option(ice.MSG_USERHOST), "://", "%3A%2F%2F"),
|
|
||||||
))
|
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user