diff --git a/xgfs/files/BIU_20240523_172749.zip b/xgfs/files/BIU_20240523_172749.zip new file mode 100644 index 0000000..f0a4780 Binary files /dev/null and b/xgfs/files/BIU_20240523_172749.zip differ diff --git a/xgfs/internal/handler/handler.go b/xgfs/internal/handler/handler.go index 1e4e1e0..0429642 100644 --- a/xgfs/internal/handler/handler.go +++ b/xgfs/internal/handler/handler.go @@ -68,16 +68,18 @@ func ReceiveHandler(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodGet: // serve upload page for receive - tmpl, err := template.New("index").Parse(web.UploadPage) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - // 获取当前设备名称 - err = tmpl.Execute(w, config.G.DeviceName) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - } + // tmpl, err := template.New("index").Parse(web.UploadPage) + // if err != nil { + // http.Error(w, err.Error(), http.StatusInternalServerError) + // return + // } + // // 获取当前设备名称 + // err = tmpl.Execute(w, config.G.DeviceName) + // if err != nil { + // http.Error(w, err.Error(), http.StatusInternalServerError) + // } + // + fmt.Fprintf(w, "%s:接收文件中...", r.Host) case http.MethodPost: // receive file and save file, header, err := r.FormFile("file") diff --git a/xgfs/main.go b/xgfs/main.go index f91963f..3f43fb8 100644 --- a/xgfs/main.go +++ b/xgfs/main.go @@ -34,8 +34,8 @@ func receiveClient() error { // 注释上面的局域网广播 fmt.Println("xtfs run as receive role...") // 显示状态等 - http.HandleFunc("/", handler.ReceiveStatus) - // http.HandleFunc("/upload", handler.ReceiveHandler) + // http.HandleFunc("/", handler.ReceiveStatus) + http.HandleFunc("/", handler.ReceiveHandler) // http.Handle("/static/", http.StripPrefix("/static/", // http.FileServer(http.FS(web.StaticFs)))) diff --git a/xgfs/xtfs b/xgfs/xtfs index 83ce2f1..785299c 100644 Binary files a/xgfs/xtfs and b/xgfs/xtfs differ