1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 17:44:05 +08:00
This commit is contained in:
harveyshao 2022-06-04 16:21:52 +08:00
parent 7bead22151
commit db15dfed1b

View File

@ -296,7 +296,9 @@ func init() {
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
cli.NodeInfo(m, WORKER, ice.Info.PathName) cli.NodeInfo(m, WORKER, ice.Info.PathName)
AddRewrite(func(w http.ResponseWriter, r *http.Request) bool { AddRewrite(func(w http.ResponseWriter, r *http.Request) bool {
if r.Method == SPIDE_GET && r.URL.Path == ice.PS { if r.Method == SPIDE_GET {
switch r.URL.Path {
case ice.PS:
msg := m.Spawn(SERVE, w, r) msg := m.Spawn(SERVE, w, r)
if share := r.URL.Query().Get("share"); share != "" { if share := r.URL.Query().Get("share"); share != "" {
switch msg := msg.Cmd(SHARE, share); msg.Append(mdb.TYPE) { switch msg := msg.Cmd(SHARE, share); msg.Append(mdb.TYPE) {
@ -314,6 +316,10 @@ func init() {
} }
Render(msg, ice.RENDER_DOWNLOAD, path.Join(msg.Config(kit.Keys(repos, nfs.PATH)), msg.Config(kit.Keys(repos, INDEX)))) Render(msg, ice.RENDER_DOWNLOAD, path.Join(msg.Config(kit.Keys(repos, nfs.PATH)), msg.Config(kit.Keys(repos, INDEX))))
return true // 网站主页 return true // 网站主页
case "/help/":
r.URL.Path = "/help/tutor.shy"
}
} }
return false return false
}) })