|
|
@ -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) { |
|
|
func Supfile(w http.ResponseWriter, r *http.Request) { |
|
|
r.ParseForm() |
|
|
r.ParseForm() |
|
|
@ -104,8 +110,15 @@ func Supfile(w http.ResponseWriter, r *http.Request) { |
|
|
// 创建udp 渠道发送数据
|
|
|
// 创建udp 渠道发送数据
|
|
|
message := fmt.Sprintf("%s%s%s", "xdml|", bbpath, "|sender") |
|
|
message := fmt.Sprintf("%s%s%s", "xdml|", bbpath, "|sender") |
|
|
UdpSendFile(serip[0], ziprl, bfile, message, w) |
|
|
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文件
|
|
|
// udp 方式发送zip文件
|
|
|
|