diff --git a/fssc/internal/handler/handler.go b/fssc/internal/handler/handler.go index 8ed0871..216e393 100644 --- a/fssc/internal/handler/handler.go +++ b/fssc/internal/handler/handler.go @@ -65,6 +65,12 @@ func UpServer(w http.ResponseWriter, r *http.Request) { } +// 返回结果 +type Rtjson struct { + Status string `json:"status"` + Message string `json:"message"` +} + // 处理单文件同步 func Supfile(w http.ResponseWriter, r *http.Request) { r.ParseForm() @@ -104,8 +110,15 @@ func Supfile(w http.ResponseWriter, r *http.Request) { // 创建udp 渠道发送数据 message := fmt.Sprintf("%s%s%s", "xdml|", bbpath, "|sender") UdpSendFile(serip[0], ziprl, bfile, message, w) + // 输出json + rtjson := Rtjson{ + Status: "200", + Message: "success", + } + json.NewEncoder(w).Encode(rtjson) + // 执行完 跳转到 首页 - http.Redirect(w, r, "/", http.StatusFound) + //http.Redirect(w, r, "/", http.StatusFound) } // udp 方式发送zip文件