diff --git a/base/web/serve.go b/base/web/serve.go index 5690a077..0fb65340 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -175,6 +175,8 @@ func _serve_handle(key string, cmd *ice.Command, msg *ice.Message, w http.Respon RenderCookie(msg, v[0]) } } + msg.Debug("what %v", msg.Option(ice.MSG_USERWEB)) + msg.Debug("what %v", msg.Option(ice.MSG_SESSID)) if msg.Option(ice.MSG_USERPOD, msg.Option(ice.POD)); msg.Optionv(ice.MSG_CMDS) == nil { if p := strings.TrimPrefix(r.URL.Path, key); p != "" { // 地址命令 diff --git a/core/code/autogen.go b/core/code/autogen.go index 84bb526e..288eba34 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -9,6 +9,7 @@ import ( "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/nfs" "shylinux.com/x/icebergs/base/ssh" + "shylinux.com/x/icebergs/base/tcp" "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" ) @@ -88,10 +89,18 @@ func _autogen_source(m *ice.Message, main, file string) { m.Cmd(nfs.PUSH, strings.ReplaceAll(main, ice.PT+GO, ice.PT+SHY), ice.NL, "source "+strings.TrimPrefix(file, ice.SRC+ice.PS)) } func _autogen_mod(m *ice.Message, file string) (mod string) { + host := kit.ParseURLMap(m.Option(ice.MSG_USERWEB))[tcp.HOSTNAME] + if host == "" { + host = path.Base(kit.Path("")) + } else { + host = path.Join(host, "x", path.Base(kit.Path(""))) + } + m.Debug("what %v", host) + m.Cmd(nfs.DEFS, ice.GO_MOD, kit.Format(`module %s go 1.11 -`, path.Base(kit.Path("")))) +`, host)) m.Cmd(nfs.CAT, file, func(line string) { if strings.HasPrefix(line, "module") {