forked from x/icebergs
add web.team.corporation
This commit is contained in:
parent
7b21b28b98
commit
38d74bc01f
@ -104,7 +104,7 @@ func _dream_list_more(m *ice.Message, simple bool) *ice.Message {
|
||||
defer m.PushButton(strings.Join(msg.Appendv(ctx.ACTION), ""))
|
||||
}
|
||||
case aaa.LOGIN:
|
||||
value[mdb.TEXT] = kit.JoinWord(value[AGENT], value[cli.SYSTEM], value[aaa.IP])
|
||||
value[mdb.TEXT] = kit.JoinWord(value[AGENT], value[cli.SYSTEM], value[aaa.IP], kit.Format(PublicIP(m, value[aaa.IP])))
|
||||
defer m.PushButton(GRANT)
|
||||
default:
|
||||
return
|
||||
|
@ -150,7 +150,7 @@ func RenderMain(m *ice.Message) *ice.Message {
|
||||
}
|
||||
m.Options(nfs.SCRIPT, ice.SRC_MAIN_JS, nfs.VERSION, RenderVersion(m))
|
||||
m.OptionDefault(mdb.ICONS, strings.Split(m.Resource(ice.Info.NodeIcon), "?")[0]+m.Option(nfs.VERSION))
|
||||
m.OptionDefault(TITLE, kit.Select("localhost:9020", UserWeb(m).Host, m.Option(ice.MSG_USERPOD)))
|
||||
m.OptionDefault(TITLE, kit.Select("localhost:9020", UserWeb(m).Host, m.Option(ice.MSG_USERPOD), ice.Info.Titles))
|
||||
return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m))
|
||||
}
|
||||
func RenderCmds(m *ice.Message, cmds ...ice.Any) {
|
||||
|
@ -469,7 +469,9 @@ func PublicIP(m *ice.Message, arg ...string) ice.Any {
|
||||
if len(arg) == 0 {
|
||||
return SpideGet(m, "http://ip-api.com/json")
|
||||
}
|
||||
return kit.Format(kit.Value(SpideGet(m, "http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8", "query", arg[0]), "data.0.location"))
|
||||
return mdb.Cache(m, "web.spide.location."+arg[0], func() ice.Any {
|
||||
return kit.Format(kit.Value(SpideGet(m, "http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8", "query", arg[0]), "data.0.location"))
|
||||
})
|
||||
}
|
||||
func SpideGet(m *ice.Message, arg ...ice.Any) ice.Any {
|
||||
return kit.UnMarshal(m.Cmdx(http.MethodGet, arg))
|
||||
|
@ -14,8 +14,8 @@ func init() {
|
||||
web.Index.Register(Index, &web.Frame{},
|
||||
HEADER, FOOTER,
|
||||
IFRAME, FAVOR,
|
||||
MESSAGE, TUTOR,
|
||||
FLOWS,
|
||||
TUTOR, FLOWS,
|
||||
MESSAGE,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,7 @@ func init() {
|
||||
m.Option(aaa.IP, msg.Append(aaa.IP))
|
||||
m.Option(ice.MSG_USERUA, msg.Append(aaa.UA))
|
||||
m.Options(web.ParseUA(m))
|
||||
m.Options("location", web.PublicIP(m, m.Option(aaa.IP)))
|
||||
if m.EchoInfoButton(nfs.Template(m, "auth.html"), aaa.CONFIRM); m.IsWeixinUA() {
|
||||
m.OptionFields(mdb.DETAIL)
|
||||
m.Push(web.SPACE, arg[0])
|
||||
|
@ -146,6 +146,8 @@ func init() {
|
||||
m.Option(ice.MSG_NODETYPE, ice.Info.NodeType)
|
||||
kit.If(m.Option(ice.MSG_USERPOD), func(p string) {
|
||||
m.Option(ice.MSG_NODETYPE, m.Cmdx(web.SPACE, p, cli.RUNTIME, ice.MSG_NODETYPE))
|
||||
}, func() {
|
||||
m.Option("titles", ice.Info.Title())
|
||||
})
|
||||
m.Option("favicon", m.Cmd(web.SPACE, m.Option(ice.MSG_USERPOD), web.SPACE, ice.INFO).Append(mdb.ICONS))
|
||||
m.Option(aaa.LANGUAGE, strings.ReplaceAll(strings.ToLower(kit.Select("", kit.Split(kit.GetValid(
|
||||
|
20
core/team/corporation.go
Normal file
20
core/team/corporation.go
Normal file
@ -0,0 +1,20 @@
|
||||
package team
|
||||
|
||||
import (
|
||||
ice "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
)
|
||||
|
||||
func init() {
|
||||
const corporation = "corporation"
|
||||
Index.MergeCommands(ice.Commands{
|
||||
corporation: {Name: "corporation username auto", Help: "企业法人", Actions: ice.MergeActions(ice.Actions{}, mdb.ExportHashAction(
|
||||
mdb.SHORT, "username", mdb.FIELD, "time,username,mobile,idnumber,usci,email,portal",
|
||||
)), Hand: func(m *ice.Message, arg ...string) {
|
||||
mdb.HashSelect(m, arg...)
|
||||
web.PushPodCmd(m, "", arg...)
|
||||
m.Action(mdb.CREATE)
|
||||
}},
|
||||
})
|
||||
}
|
4
info.go
4
info.go
@ -44,10 +44,11 @@ func (s MakeInfo) Versions() string {
|
||||
}
|
||||
}
|
||||
func (s info) Title() string {
|
||||
p := path.Base(kit.Select(s.Pathname, s.Make.Remote))
|
||||
p := path.Base(kit.Select(s.Pathname, s.Make.Remote, s.Titles))
|
||||
if strings.HasPrefix(p, "20") {
|
||||
p = kit.Join(strings.Split(p, "-")[1:], "-")
|
||||
}
|
||||
return p
|
||||
return kit.Capital(p)
|
||||
}
|
||||
|
||||
@ -67,6 +68,7 @@ type info struct {
|
||||
|
||||
Pwd string
|
||||
Lang string
|
||||
Titles string
|
||||
System string
|
||||
Domain string
|
||||
CtxRoot string
|
||||
|
Loading…
x
Reference in New Issue
Block a user