From deca0a8e8dc4741e623968eb5f61a2b54744360b Mon Sep 17 00:00:00 2001 From: shylinux Date: Fri, 18 Nov 2022 22:39:04 +0800 Subject: [PATCH] opt some --- base/aaa/user.go | 6 +++--- base/web/serve.go | 4 ++-- core/code/publish.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/base/aaa/user.go b/base/aaa/user.go index f40fa2ae..8b205a63 100644 --- a/base/aaa/user.go +++ b/base/aaa/user.go @@ -72,8 +72,8 @@ const USER = "user" func init() { Index.MergeCommands(ice.Commands{ USER: {Name: "user username auto create", Help: "用户", Actions: ice.MergeActions(ice.Actions{ - mdb.CREATE: {Name: "create username password userrole=void,tech", Help: "创建", Hand: func(m *ice.Message, arg ...string) { - _user_create(m, m.Option(USERNAME), m.Option(PASSWORD), m.OptionSimple(USERROLE)...) + mdb.CREATE: {Name: "create username password userrole=void,tech usernick", Help: "创建", Hand: func(m *ice.Message, arg ...string) { + _user_create(m, m.Option(USERNAME), m.Option(PASSWORD), m.OptionSimple(USERROLE, USERNICK)...) }}, LOGIN: {Name: "login username password", Help: "登录", Hand: func(m *ice.Message, arg ...string) { _user_login(m, m.Option(USERNAME), m.Option(PASSWORD)) @@ -87,7 +87,7 @@ func UserRoot(m *ice.Message, arg ...string) *ice.Message { // password username userrole := m.Option(ice.MSG_USERROLE, kit.Select(ROOT, arg, 2)) m.Option(ice.MSG_USERNICK, UserNick(m, username)) if len(arg) > 0 { - m.Cmd(USER, mdb.CREATE, username, kit.Select("", arg, 0), userrole) + m.Cmd(USER, mdb.CREATE, username, kit.Select("", arg, 0), userrole, kit.Select("", arg, 3)) ice.Info.UserName = username } return m diff --git a/base/web/serve.go b/base/web/serve.go index 66085b59..dc803362 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -93,7 +93,7 @@ func _serve_start(m *ice.Message) { if m.Option("staffname") != "" { m.Config("staffname", m.Option(aaa.USERNAME, m.Option("staffname"))) } - aaa.UserRoot(m, m.Option(aaa.PASSWORD), m.Option(aaa.USERNAME), m.Option(aaa.USERROLE)) + aaa.UserRoot(m, m.Option(aaa.PASSWORD), m.Option(aaa.USERNAME), m.Option(aaa.USERROLE), m.Option(aaa.USERNICK)) m.Target().Start(m, m.OptionSimple(tcp.HOST, tcp.PORT)...) m.Go(func() { m.Cmd(BROAD, SERVE) }) @@ -364,7 +364,7 @@ func init() { ctx.DisplayStorySpide(m, lex.PREFIX, m.ActionKey(), nfs.ROOT, MergeLink(m, ice.PS)) } }}, - cli.START: {Name: "start dev proto=http host port=9020 nodename password username userrole staffname", Help: "启动", Hand: func(m *ice.Message, arg ...string) { + cli.START: {Name: "start dev proto=http host port=9020 nodename password username userrole usernick staffname", Help: "启动", Hand: func(m *ice.Message, arg ...string) { _serve_start(m) }}, }, mdb.HashAction())}, diff --git a/core/code/publish.go b/core/code/publish.go index 667023b5..95bbf02b 100644 --- a/core/code/publish.go +++ b/core/code/publish.go @@ -132,8 +132,8 @@ func init() { var _contexts = kit.Dict( ice.MISC, `# 下载命令 curl 或 wget -export ctx_dev={{.Option "httphost"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev; source $ctx_temp app username {{.Option "user.name"}} -export ctx_dev={{.Option "httphost"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp); wget -O $ctx_temp -q $ctx_dev; source $ctx_temp app username {{.Option "user.name"}} +export ctx_dev={{.Option "httphost"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev; source $ctx_temp app username {{.Option "user.name"}} usernick {{.Option "user.nick"}} +export ctx_dev={{.Option "httphost"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp); wget -O $ctx_temp -q $ctx_dev; source $ctx_temp app username {{.Option "user.name"}} usernick {{.Option "user.nick"}} `, ice.CORE, `# 下载工具 curl 或 wget ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Cmdx "spide" "shy" "client.url"}}; source $ctx_temp binary