mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt mp
This commit is contained in:
parent
c05d3b2b55
commit
a5e7041e1f
@ -25,14 +25,13 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
m.Option(mdb.FIELDS, kit.Select("time,hash,name,data", mdb.DETAIL, len(arg) > 0))
|
m.Option(mdb.FIELDS, kit.Select("time,hash,name,data", mdb.DETAIL, len(arg) > 0))
|
||||||
m.Cmdy(mdb.SELECT, cmd, "", mdb.HASH, kit.MDB_HASH, arg)
|
m.Cmd(mdb.SELECT, cmd, "", mdb.HASH, kit.MDB_HASH, arg).Table(func(index int, value map[string]string, head []string) {
|
||||||
|
m.Push("", value, kit.Split(kit.Select("time,hash,name", "time,name", len(arg) > 0)))
|
||||||
|
|
||||||
m.Table(func(index int, value map[string]string, head []string) {
|
if m.PushDownload(value[kit.MDB_NAME], "/share/cache/"+value[kit.MDB_DATA]); len(arg) > 0 {
|
||||||
m.PushDownload(value[kit.MDB_NAME], "/share/cache/"+value["data"])
|
switch {
|
||||||
if len(arg) > 0 {
|
case kit.ExtIsImage(value[kit.MDB_NAME]):
|
||||||
switch kit.Ext(value["name"]) {
|
m.PushImages(kit.MDB_IMAGE, "/share/cache/"+value[kit.MDB_DATA])
|
||||||
case "png":
|
|
||||||
m.PushImages("image", "/share/cache/"+value["data"])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -40,9 +40,8 @@ func init() {
|
|||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
LOCATION: {Name: "location text auto getLocation", Help: "地理位置", Action: map[string]*ice.Action{
|
LOCATION: {Name: "location text auto getLocation", Help: "地理位置", Action: map[string]*ice.Action{
|
||||||
OPENLOCATION: {Name: "create type=text name address latitude longitude", Help: "地图", Hand: func(m *ice.Message, arg ...string) {
|
OPENLOCATION: {Name: "create type=text name address latitude longitude", Help: "地图", Hand: func(m *ice.Message, arg ...string) {}},
|
||||||
}},
|
GETLOCATION: {Name: "getLocation", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||||
GETLOCATION: {Name: "create type=text name address latitude longitude", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
_trans(arg, map[string]string{ADDRESS: "text"})
|
_trans(arg, map[string]string{ADDRESS: "text"})
|
||||||
m.Cmdy(mdb.INSERT, LOCATION, "", mdb.HASH, arg)
|
m.Cmdy(mdb.INSERT, LOCATION, "", mdb.HASH, arg)
|
||||||
}},
|
}},
|
||||||
|
@ -257,8 +257,8 @@ func init() {
|
|||||||
m.Cmdy(mdb.DELETE, RIVER, kit.Keys(kit.MDB_HASH, m.Option(ice.MSG_RIVER), USER), mdb.HASH, aaa.USERNAME, m.Option(aaa.USERNAME))
|
m.Cmdy(mdb.DELETE, RIVER, kit.Keys(kit.MDB_HASH, m.Option(ice.MSG_RIVER), USER), mdb.HASH, aaa.USERNAME, m.Option(aaa.USERNAME))
|
||||||
}},
|
}},
|
||||||
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(aaa.USER)
|
m.Cmdy("aaa.user")
|
||||||
m.Appendv(ice.MSG_APPEND, aaa.USERNAME, aaa.USERNICK)
|
m.Appendv(ice.MSG_APPEND, aaa.USERNAME, aaa.USERZONE, aaa.USERNICK)
|
||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
m.Option(mdb.FIELDS, kit.Select("time,username", mdb.DETAIL, len(arg) > 0))
|
m.Option(mdb.FIELDS, kit.Select("time,username", mdb.DETAIL, len(arg) > 0))
|
||||||
@ -348,6 +348,7 @@ func init() {
|
|||||||
|
|
||||||
"/river": {Name: "/river", Help: "小河流", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
"/river": {Name: "/river", Help: "小河流", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) {
|
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) {
|
||||||
|
m.Render(web.STATUS, 401)
|
||||||
return // 没有登录
|
return // 没有登录
|
||||||
}
|
}
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
|
@ -27,19 +27,20 @@ var Index = &ice.Context{Name: MP, Help: "小程序",
|
|||||||
},
|
},
|
||||||
Commands: map[string]*ice.Command{
|
Commands: map[string]*ice.Command{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
m.Load()
|
|
||||||
m.Cmd(web.SPIDE, mdb.CREATE, WEIXIN, m.Conf(LOGIN, kit.Keys(kit.MDB_META, WEIXIN)))
|
m.Cmd(web.SPIDE, mdb.CREATE, WEIXIN, m.Conf(LOGIN, kit.Keys(kit.MDB_META, WEIXIN)))
|
||||||
|
m.Load()
|
||||||
}},
|
}},
|
||||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
m.Save()
|
m.Save()
|
||||||
}},
|
}},
|
||||||
|
|
||||||
ACCESS: {Name: "access appid auto login", Help: "认证", Action: map[string]*ice.Action{
|
ACCESS: {Name: "access appid auto login", Help: "认证", Action: map[string]*ice.Action{
|
||||||
LOGIN: {Name: "login appid appmm", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
LOGIN: {Name: "login appid appmm", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPID), m.Option(APPID))
|
m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPID), m.Option(APPID))
|
||||||
m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPMM), m.Option(APPMM))
|
m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPMM), m.Option(APPMM))
|
||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
m.Push(APPID, m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPID)))
|
m.Echo(m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPID)))
|
||||||
}},
|
}},
|
||||||
|
|
||||||
"/login/": {Name: "/login/", Help: "认证", Action: map[string]*ice.Action{
|
"/login/": {Name: "/login/", Help: "认证", Action: map[string]*ice.Action{
|
||||||
@ -66,7 +67,6 @@ var Index = &ice.Context{Name: MP, Help: "小程序",
|
|||||||
m.Cmdy(chat.SCAN)
|
m.Cmdy(chat.SCAN)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -6,19 +6,18 @@ refer "" `
|
|||||||
源码 https://github.com/shylinux/icebergs/blob/master/misc/mp/mp.go
|
源码 https://github.com/shylinux/icebergs/blob/master/misc/mp/mp.go
|
||||||
`
|
`
|
||||||
image qrcode `https://weixin.qq.com`
|
image qrcode `https://weixin.qq.com`
|
||||||
spark
|
|
||||||
|
|
||||||
chapter "应用"
|
chapter "应用"
|
||||||
field location web.chat.location
|
|
||||||
field paste web.chat.paste
|
|
||||||
field scan web.chat.scan
|
field scan web.chat.scan
|
||||||
field feel web.chat.feel
|
field paste web.chat.paste
|
||||||
|
field location web.chat.location
|
||||||
|
|
||||||
chapter "权限"
|
chapter "权限"
|
||||||
field access web.chat.mp.access
|
field access web.chat.mp.access
|
||||||
|
field share web.share
|
||||||
field user aaa.user
|
field user aaa.user
|
||||||
field sess aaa.sess
|
field sess aaa.sess
|
||||||
|
|
||||||
chapter "项目"
|
chapter "项目"
|
||||||
field "icebergs" web.code.git.trend args `icebergs`
|
field "icebergs" web.code.git.trend args `icebergs`
|
||||||
field "icebergs" web.code.inner args `usr/icebergs/ misc/mp/mp.go 1`
|
field "icebergs" web.code.inner args `usr/icebergs/ misc/mp/mp.go`
|
||||||
|
@ -121,7 +121,9 @@ var Index = &ice.Context{Name: WX, Help: "公众号",
|
|||||||
m.Cmd(web.SPIDE, mdb.CREATE, WEIXIN, m.Conf(LOGIN, kit.Keys(kit.MDB_META, WEIXIN)))
|
m.Cmd(web.SPIDE, mdb.CREATE, WEIXIN, m.Conf(LOGIN, kit.Keys(kit.MDB_META, WEIXIN)))
|
||||||
m.Load()
|
m.Load()
|
||||||
}},
|
}},
|
||||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save() }},
|
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
m.Save()
|
||||||
|
}},
|
||||||
|
|
||||||
ACCESS: {Name: "access appid auto ticket token login", Help: "认证", Action: map[string]*ice.Action{
|
ACCESS: {Name: "access appid auto ticket token login", Help: "认证", Action: map[string]*ice.Action{
|
||||||
LOGIN: {Name: "login appid appmm token", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
LOGIN: {Name: "login appid appmm token", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -22,5 +22,5 @@ field sess aaa.sess
|
|||||||
|
|
||||||
chapter "项目"
|
chapter "项目"
|
||||||
field "icebergs" web.code.git.trend args `icebergs`
|
field "icebergs" web.code.git.trend args `icebergs`
|
||||||
field "icebergs" web.code.inner args `usr/icebergs/ misc/wx/wx.go 1`
|
field "icebergs" web.code.inner args `usr/icebergs/ misc/wx/wx.go`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user