From 287ad553accabf98fb2b6ef5bffb52ac6bd33c80 Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Fri, 5 Jul 2024 15:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E8=BE=93=E5=87=BAjs?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fssc/internal/handler/handler.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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文件