Browse Source

增加页面调整,修正根目录单文件引起的异常

master
453530270@qq.com 2 years ago
parent
commit
7772c0e715
  1. BIN
      fssc/fssc
  2. 20
      fssc/internal/handler/handler.go

BIN
fssc/fssc

Binary file not shown.

20
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)
}
// 发送拦截

Loading…
Cancel
Save