forked from x/icebergs
add some
This commit is contained in:
parent
fda6e6f969
commit
74075002f1
@ -43,8 +43,8 @@ const (
|
||||
TOKEN = "token"
|
||||
TOKENS = "tokens"
|
||||
EXPIRES = "expires"
|
||||
TICKET = "ticket"
|
||||
EXPIRE = "expire"
|
||||
TICKET = "ticket"
|
||||
)
|
||||
const ACCESS = "access"
|
||||
|
||||
@ -91,11 +91,12 @@ func init() {
|
||||
}},
|
||||
aaa.LOGIN: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Cmd("", m.Option(ACCESS, arg[0])).Append(mdb.TYPE) == ice.WEB {
|
||||
m.Cmdy(SCAN, mdb.CREATE, mdb.TYPE, QR_STR_SCENE, mdb.NAME, "请授权登录", mdb.TEXT, m.Option(web.SPACE), ctx.INDEX, web.CHAT_GRANT, ctx.ARGS, m.Option(web.SPACE))
|
||||
m.Cmdy(SCAN, mdb.CREATE, mdb.TYPE, QR_STR_SCENE, mdb.NAME, "请授权登录", mdb.TEXT, m.Option(web.SPACE),
|
||||
ctx.INDEX, web.CHAT_GRANT, ctx.ARGS, m.Option(web.SPACE))
|
||||
} else {
|
||||
h := m.Cmdx(IDE, mdb.CREATE, mdb.NAME, "请授权登录", mdb.TEXT, m.Option(web.SPACE), PAGES, PAGES_ACTION, tcp.WIFI, kit.Select("", arg, 2),
|
||||
ctx.INDEX, web.CHAT_GRANT, ctx.ARGS, kit.JoinQuery(m.OptionSimple(web.SPACE, log.DEBUG)...))
|
||||
m.Echo(m.Cmdx(SCAN, UNLIMIT, SCENE, h, ENV, kit.Select("develop", arg, 1), IS_HYALINE, ice.FALSE, mdb.NAME, m.Option(web.SPACE)))
|
||||
m.Echo(m.Cmdx(SCAN, UNLIMIT, ENV, kit.Select("develop", arg, 1), SCENE, h, mdb.NAME, m.Option(web.SPACE)))
|
||||
}
|
||||
}},
|
||||
web.SPACE_GRANT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
@ -108,7 +109,9 @@ func init() {
|
||||
m.Cmd(mdb.PRUNES, m.Prefix(SCAN), "", mdb.HASH, m.OptionSimple(mdb.NAME))
|
||||
m.Cmd(mdb.PRUNES, m.Prefix(IDE), "", mdb.HASH, m.OptionSimple(mdb.NAME))
|
||||
}},
|
||||
}, gdb.EventsAction(web.SPACE_GRANT, web.SPACE_LOGIN_CLOSE), mdb.ImportantHashAction(mdb.SHORT, ACCESS, mdb.FIELD, "time,type,access,icons,usernick,appid", tcp.SERVER, CGI_BIN)), Hand: func(m *ice.Message, arg ...string) {
|
||||
}, gdb.EventsAction(web.SPACE_GRANT, web.SPACE_LOGIN_CLOSE), mdb.ImportantHashAction(
|
||||
mdb.SHORT, ACCESS, mdb.FIELD, "time,type,access,icons,usernick,appid", tcp.SERVER, CGI_BIN,
|
||||
)), Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.HashSelect(m, arg...).PushAction(web.SSO, mdb.REMOVE).StatusTimeCount(mdb.ConfigSimple(m, ACCESS, APPID), web.SERVE, m.MergeLink("/chat/wx/login/"))
|
||||
m.RewriteAppend(func(value, key string, index int) string {
|
||||
kit.If(key == cli.QRCODE, func() { value = ice.Render(m, ice.RENDER_QRCODE, value) })
|
||||
@ -128,14 +131,16 @@ func SpideGet(m *ice.Message, api string, arg ...ice.Any) ice.Any {
|
||||
}
|
||||
func Meta() ice.Map {
|
||||
return kit.Dict(ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict(
|
||||
ACCESS, "账号", APPID, "应用", SECRET, "密码",
|
||||
TOKEN, "口令", TOKENS, "令牌", TICKET, "票据",
|
||||
EXPIRES, "令牌有效期", EXPIRE, "票据有效期", EXPIRE_SECONDS, "有效期",
|
||||
ACCESS, "账号", APPID, "应用", SECRET, "密码", TOKEN, "口令",
|
||||
TOKENS, "令牌", EXPIRES, "令牌有效期",
|
||||
TICKET, "票据", EXPIRE, "票据有效期", EXPIRE_SECONDS, "有效期",
|
||||
SCENE, "场景", RIVER, "一级", STORM, "二级",
|
||||
SEX, "性别", TAGS, "标签", REMARK, "备注",
|
||||
"subscribe", "订阅", "subscribe_time", "时间",
|
||||
"nickname", "昵称", "headimgurl", "头像",
|
||||
"projectname", "项目",
|
||||
ENV, "环境", PAGES, "页面",
|
||||
), html.VALUE, kit.Dict(
|
||||
"web", "公众号", "app", "小程序",
|
||||
)))
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ import (
|
||||
|
||||
const (
|
||||
UNLIMIT = "unlimit"
|
||||
IS_HYALINE = "is_hyaline"
|
||||
QR_STR_SCENE = "QR_STR_SCENE"
|
||||
QR_LIMIT_STR_SCENE = "QR_LIMIT_STR_SCENE"
|
||||
EXPIRE_SECONDS = "expire_seconds"
|
||||
@ -25,12 +24,10 @@ const (
|
||||
const SCAN = "scan"
|
||||
|
||||
func init() {
|
||||
const ()
|
||||
Index.MergeCommands(ice.Commands{
|
||||
SCAN: {Name: "scan access hash auto", Help: "桌牌", Meta: kit.Merge(Meta(), kit.Dict(ice.CTX_TRANS, kit.Dict(html.VALUE, kit.Dict(
|
||||
QR_LIMIT_STR_SCENE, "永久码", QR_STR_SCENE, "临时码", mdb.VALID, "有效", mdb.EXPIRED, "失效",
|
||||
"develop", "开发版", "trial", "体验版", "release", "发布版",
|
||||
IS_HYALINE, "透明",
|
||||
)))), Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
@ -44,7 +41,7 @@ func init() {
|
||||
mdb.HashModify(m, mdb.HASH, h, mdb.LINK, kit.Value(res, web.URL), mdb.TIME, m.Time(kit.Format("%ss", kit.Select("60", m.Option(EXPIRE_SECONDS)))))
|
||||
m.EchoQRCode(kit.Format(kit.Value(res, web.URL)))
|
||||
}},
|
||||
UNLIMIT: {Name: "unlimit scene* env*=develop,release,trial,develop is_hyaline=true,false name", Help: "小程序码", Hand: func(m *ice.Message, arg ...string) {
|
||||
UNLIMIT: {Name: "unlimit env*=develop,release,trial,develop scene* name", Help: "小程序码", Hand: func(m *ice.Message, arg ...string) {
|
||||
defer m.ProcessInner()
|
||||
scene := m.Option(SCENE)
|
||||
meta, info := "", m.Cmd(IDE, scene)
|
||||
@ -60,7 +57,7 @@ func init() {
|
||||
meta = path.Join("s", u.Host, scene)
|
||||
}
|
||||
msg := spidePost(m, WXACODE_UNLIMIT, web.SPIDE_DATA, kit.Format(kit.Dict(
|
||||
"env_version", m.Option(ENV), "page", info.Append(PAGES), SCENE, meta, IS_HYALINE, m.Option(IS_HYALINE) == ice.TRUE,
|
||||
"env_version", m.Option(ENV), SCENE, meta, "page", info.Append(PAGES),
|
||||
html.WIDTH, kit.Int(kit.Select("360", "280", m.IsMobileUA())),
|
||||
)))
|
||||
switch kit.Select("", kit.Split(msg.Option(html.ContentType), "; "), 0) {
|
||||
@ -74,7 +71,7 @@ func init() {
|
||||
}},
|
||||
}, mdb.ExportHashAction(mdb.SHORT, mdb.UNIQ, mdb.FIELD, "time,hash,name,text,icons,space,index,args,type,image,link")), Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
m.Cmdy(ACCESS).PushAction("").Option(ice.MSG_ACTION, "")
|
||||
m.Cmdy(ACCESS).PushAction().Action()
|
||||
} else if mdb.HashSelect(m, arg[1:]...); len(arg) == 1 {
|
||||
m.Table(func(value ice.Maps) {
|
||||
m.Push(mdb.STATUS, kit.Select(mdb.VALID, mdb.EXPIRED, value[mdb.TYPE] == QR_STR_SCENE && value[mdb.TIME] < m.Time()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user