diff --git a/fssc/fssc b/fssc/fssc index 4914537..2e49e4b 100644 Binary files a/fssc/fssc and b/fssc/fssc differ diff --git a/fssc/internal/handler/handler.go b/fssc/internal/handler/handler.go index d567dfb..616fc1c 100644 --- a/fssc/internal/handler/handler.go +++ b/fssc/internal/handler/handler.go @@ -118,16 +118,25 @@ func Supfile(w http.ResponseWriter, r *http.Request) { bpath := util.Base64dec(sbpath[0]) bfile := util.Base64dec(sbfile[0]) // 替换 反斜杠 - bbpath := strings.Replace(bpath, "\\", "/", -1) + //bbpath := strings.Replace(bpath, "\\", "/", -1) + bbpath := "" + // 判断是否为空 + if bpath == "" { + // fmt.Printf("shit,it's blank path!!\n") + bbpath = "." + } else { + bbpath = filepath.ToSlash(bpath) + } + + // fmt.Printf("rel path:%s - %s", bbpath, bfile) //replacedPath := strings.ReplaceAll(path, "\\", "/") // 拼装, 文件的实际地址 ziprl := filepath.Join(config.G.FilePath, "/", bbpath, "/", bfile) - // 创建udp 渠道发送数据 message := fmt.Sprintf("%s%s%s", "xdml|", bbpath, "|sender") UdpSendFile(serip[0], ziprl, bfile, message, w) - fmt.Fprintf(w, "deubg.....") - + // 执行完 跳转到 首页 + http.Redirect(w, r, "/", http.StatusFound) } // udp 方式发送zip文件 @@ -182,7 +191,8 @@ func SendZip(w http.ResponseWriter, r *http.Request) { } else { fmt.Println("archive is not exist!!!") } - + // 执行完 跳转到 首页 + http.Redirect(w, r, "/", http.StatusFound) } // 发送拦截