mirror of
https://shylinux.com/x/icebergs
synced 2025-04-25 17:18:05 +08:00
add some
This commit is contained in:
parent
daa740ffbe
commit
d401e8ec2c
@ -102,14 +102,23 @@ func (s Client) Link(m *ice.Message, arg ...string) {
|
||||
func (s Client) User(m *ice.Message, arg ...string) {
|
||||
if res := s.Get(m, m.Option(mdb.HASH), m.Option(USERS_URL), arg...); res != nil {
|
||||
m.Info("what %v", kit.Format(res))
|
||||
m.Options(res).Cmd(aaa.USER, mdb.CREATE,
|
||||
m.Options(res)
|
||||
username := m.Option(aaa.USERNAME, m.Option(kit.Select(aaa.USERNAME, m.Option(USER_KEY))))
|
||||
if m.Cmd(aaa.USER, username).Length() > 0 {
|
||||
m.Cmd(aaa.USER, mdb.MODIFY, aaa.USERNAME, username,
|
||||
aaa.USERNICK, m.Option(kit.Select("full_name", m.Option(NICK_KEY))),
|
||||
aaa.AVATAR, m.Option(kit.Select(aaa.AVATAR_URL, m.Option(ICON_KEY))),
|
||||
)
|
||||
} else {
|
||||
m.Cmd(aaa.USER, mdb.CREATE,
|
||||
aaa.USERROLE, kit.Select(aaa.VOID, aaa.TECH, m.Option("is_admin") == ice.TRUE),
|
||||
aaa.USERNAME, m.Option(aaa.USERNAME, m.Option(kit.Select(aaa.USERNAME, m.Option(USER_KEY)))),
|
||||
aaa.USERNAME, username,
|
||||
aaa.USERNICK, m.Option(kit.Select("full_name", m.Option(NICK_KEY))),
|
||||
aaa.USERZONE, m.Option(web.DOMAIN),
|
||||
aaa.AVATAR, m.Option(kit.Select(aaa.AVATAR_URL, m.Option(ICON_KEY))),
|
||||
m.OptionSimple(aaa.LANGUAGE, aaa.EMAIL))
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s Client) Orgs(m *ice.Message, arg ...string) {}
|
||||
func (s Client) Repo(m *ice.Message, arg ...string) {}
|
||||
@ -145,7 +154,7 @@ func (s Client) Login2(m *ice.Message, arg ...string) {
|
||||
kit.Value(res, EXPIRES_IN, m.Time(kit.Format("%vs", kit.Int(kit.Value(res, EXPIRES_IN)))))
|
||||
m.Info("what %v", kit.Format(res))
|
||||
m.Options(res)
|
||||
if s.User(m, m.OptionSimple(ACCESS_TOKEN, "openid")...); !m.WarnNotValid(m.Option(aaa.USERNAME) == "") && m.R != nil {
|
||||
if s.User(m, m.OptionSimple("openid")...); !m.WarnNotValid(m.Option(aaa.USERNAME) == "") && m.R != nil {
|
||||
m.Cmd(aaa.USER, mdb.MODIFY, m.OptionSimple(aaa.USERNAME), kit.Simple(res))
|
||||
web.RenderCookie(m.Message, aaa.SessCreate(m.Message, m.Option(aaa.USERNAME)))
|
||||
m.ProcessBack("-2")
|
||||
|
@ -84,6 +84,9 @@ func init() {
|
||||
AGENT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
ctx.OptionFromConfig(m, ACCESS, APPID)
|
||||
}},
|
||||
"user": {Name: "user openid", Hand: func(m *ice.Message, arg ...string) {
|
||||
SpideGet(m, "user/info", "openid", m.Option("openid"))
|
||||
}},
|
||||
"api": {Name: "api method=GET,POST path params", Hand: func(m *ice.Message, arg ...string) {
|
||||
switch m.Option("method") {
|
||||
case "POST":
|
||||
@ -134,7 +137,7 @@ func init() {
|
||||
}, gdb.EventsAction(web.SPACE_GRANT, web.SPACE_LOGIN_CLOSE), mdb.ExportHashAction(
|
||||
mdb.SHORT, ACCESS, mdb.FIELD, "time,type,access,icons,usernick,appid,secret,token", tcp.SERVER, CGI_BIN,
|
||||
)), Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.HashSelect(m, arg...).PushAction(OAUTH, web.SSO, TICKET, TOKENS, STABLE_TOKEN, "api", mdb.REMOVE).StatusTimeCount(mdb.ConfigSimple(m, ACCESS, APPID), web.SERVE, m.MergeLink("/chat/wx/login/"))
|
||||
mdb.HashSelect(m, arg...).PushAction(OAUTH, web.SSO, TICKET, TOKENS, STABLE_TOKEN, "user", "api", 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) })
|
||||
return value
|
||||
|
@ -31,6 +31,9 @@ func init() {
|
||||
}},
|
||||
SCAN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(SCAN, m.Option(ACCESS), arg[0])
|
||||
m.Cmdy(TEXT, web.LINK, m.MergePodCmd(msg.Append(web.SPACE), msg.Append(ctx.INDEX)),
|
||||
msg.Append(mdb.NAME), msg.Append(mdb.TEXT), msg.Append(mdb.ICONS))
|
||||
return
|
||||
m.Options(ice.MSG_USERPOD, msg.Append(web.SPACE))
|
||||
link := m.Cmd(web.SHARE, mdb.CREATE, mdb.TYPE, web.FIELD, mdb.NAME, msg.Append(ctx.INDEX), mdb.TEXT, msg.Append(ctx.ARGS)).Option(web.LINK)
|
||||
m.Cmdy(TEXT, web.LINK, link, msg.Append(mdb.NAME), msg.Append(mdb.TEXT), msg.Append(mdb.ICONS))
|
||||
|
@ -33,12 +33,16 @@ func init() {
|
||||
switch arg[0] {
|
||||
case SCENE:
|
||||
m.Cmdy(IDE).Cut(mdb.HASH, mdb.NAME, PAGES, ctx.INDEX).RenameAppend(mdb.HASH, arg[0])
|
||||
default:
|
||||
mdb.HashInputs(m, arg)
|
||||
}
|
||||
}},
|
||||
mdb.CREATE: {Name: "create type*=QR_STR_SCENE,QR_LIMIT_STR_SCENE name*=1 text icons expire_seconds=3600 space index* args", Hand: func(m *ice.Message, arg ...string) {
|
||||
h := mdb.HashCreate(m.Spawn(), arg)
|
||||
res := SpidePost(m, QRCODE_CREATE, "action_name", m.Option(mdb.TYPE), "action_info.scene.scene_str", h, m.OptionSimple(EXPIRE_SECONDS))
|
||||
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)))))
|
||||
mdb.HashModify(m, mdb.HASH, h, mdb.LINK, kit.Value(res, web.URL),
|
||||
"ticket", kit.Value(res, "ticket"),
|
||||
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 env*=develop,release,trial,develop scene* name", Help: "小程序码", Hand: func(m *ice.Message, arg ...string) {
|
||||
@ -78,6 +82,7 @@ func init() {
|
||||
}).Action(mdb.CREATE, UNLIMIT)
|
||||
} else {
|
||||
kit.If(m.Time() < m.Append(mdb.TIME), func() { m.PushQRCode(cli.QRCODE, m.Append(mdb.LINK)) })
|
||||
m.EchoImages("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" + m.Append("ticket"))
|
||||
}
|
||||
}},
|
||||
})
|
||||
|
@ -24,7 +24,7 @@ func init() {
|
||||
web.LINK: {Name: "link link name text icons", Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Option(mdb.ICONS) == "", func() { m.Option(mdb.ICONS, m.Cmdv(ACCESS, m.Option(ACCESS), mdb.ICONS)) })
|
||||
m.Option(mdb.ICONS, web.ShareLocal(m, m.Option(mdb.ICONS)))
|
||||
m.Cmdy("", m.OptionDefault(mdb.TEXT, "工具系统"), "link.xml")
|
||||
m.Cmdy("", m.OptionDefault(mdb.TEXT, ice.Info.Titles), "link.xml")
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Echo(nfs.Template(m.Options(mdb.TEXT, arg[0]), kit.Select("welcome.xml", arg, 1))).RenderResult()
|
||||
|
Loading…
x
Reference in New Issue
Block a user