forked from x/icebergs
fix login
This commit is contained in:
parent
b482caf902
commit
b83f39847d
@ -31,8 +31,8 @@ func _serve_login(msg *ice.Message, cmds []string, w http.ResponseWriter, r *htt
|
||||
// 自动认证
|
||||
if aaa.UserLogin(msg, cli.UserName, cli.PassWord) {
|
||||
if strings.HasPrefix(msg.Option(ice.MSG_USERUA), "Mozilla/5.0") {
|
||||
msg.Option(ice.MSG_SESSID, aaa.SessCreate(msg, msg.Option(ice.MSG_USERNAME), msg.Option(ice.MSG_USERROLE)))
|
||||
Render(msg, "cookie", msg.Option(ice.MSG_SESSID))
|
||||
// msg.Option(ice.MSG_SESSID, aaa.SessCreate(msg, msg.Option(ice.MSG_USERNAME), msg.Option(ice.MSG_USERROLE)))
|
||||
// Render(msg, "cookie", msg.Option(ice.MSG_SESSID))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -290,7 +290,7 @@ func init() {
|
||||
var data interface{}
|
||||
m.Assert(json.NewDecoder(res.Body).Decode(&data))
|
||||
data = kit.KeyValue(map[string]interface{}{}, "", data)
|
||||
m.Info("res: %s", kit.Formats(data))
|
||||
m.Info("res: %s", kit.Format(data))
|
||||
m.Push("", data)
|
||||
}
|
||||
})
|
||||
|
@ -1,14 +1,12 @@
|
||||
package code
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
ice "github.com/shylinux/icebergs"
|
||||
"github.com/shylinux/icebergs/base/cli"
|
||||
"github.com/shylinux/icebergs/base/web"
|
||||
kit "github.com/shylinux/toolkits"
|
||||
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
@ -35,16 +33,8 @@ func init() {
|
||||
}
|
||||
|
||||
// 下载文件
|
||||
h := m.Cmdx(web.SPIDE, "dev", web.CACHE, http.MethodGet, "/publish/"+kit.Format(value[kit.MDB_FILE]))
|
||||
if h == "" {
|
||||
exit = false
|
||||
return
|
||||
}
|
||||
|
||||
// 升级记录
|
||||
m.Cmd(web.STORY, web.CATCH, "bin", value[kit.MDB_PATH], h)
|
||||
m.Cmd(web.STORY, web.WATCH, h, path.Join(m.Conf(UPGRADE, "meta.path"), kit.Format(value[kit.MDB_PATH])))
|
||||
m.Cmd(web.STORY, web.WATCH, h, value[kit.MDB_PATH])
|
||||
msg := m.Cmd(web.SPIDE, "dev", web.CACHE, http.MethodGet, "/publish/"+kit.Format(value[kit.MDB_FILE]))
|
||||
m.Cmd(web.STORY, web.WATCH, msg.Append(kit.MDB_FILE), value[kit.MDB_PATH])
|
||||
os.Chmod(kit.Format(value[kit.MDB_PATH]), 0770)
|
||||
})
|
||||
if exit {
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
ice "github.com/shylinux/icebergs"
|
||||
"github.com/shylinux/icebergs/base/cli"
|
||||
"github.com/shylinux/icebergs/base/gdb"
|
||||
"github.com/shylinux/icebergs/base/mdb"
|
||||
"github.com/shylinux/icebergs/base/web"
|
||||
"github.com/shylinux/icebergs/core/code"
|
||||
kit "github.com/shylinux/toolkits"
|
||||
@ -67,7 +66,7 @@ var Index = &ice.Context{Name: "docker", Help: "虚拟机",
|
||||
|
||||
m.Table(func(index int, value map[string]string, head []string) {
|
||||
for _, k := range []string{"start", "clear"} {
|
||||
m.Push(k, m.Cmdx(mdb.RENDER, web.RENDER.Button, k))
|
||||
m.Push(k, m.Cmdx("_render", web.RENDER.Button, k))
|
||||
}
|
||||
})
|
||||
}},
|
||||
@ -114,7 +113,7 @@ var Index = &ice.Context{Name: "docker", Help: "虚拟机",
|
||||
|
||||
m.Table(func(index int, value map[string]string, head []string) {
|
||||
for _, k := range []string{"open", "start", "stop", "restart", "clear"} {
|
||||
m.Push(k, m.Cmdx(mdb.RENDER, web.RENDER.Button, k))
|
||||
m.Push(k, m.Cmdx("_render", web.RENDER.Button, k))
|
||||
}
|
||||
})
|
||||
}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user