feat(frpAct): add Windows/Systemd/Init.d service boot control. BUT WINDOWS STILL HAS BUGS AND LINUX HAS NOT BEEN TESTED.

This commit is contained in:
2026-03-24 23:23:34 +08:00
parent e335ce4da6
commit 802a726464
6 changed files with 994 additions and 92 deletions
+4 -1
View File
@@ -16,13 +16,16 @@ type Response struct {
Data interface{} `json:"data,omitempty"`
}
func SendErrorResponse(w http.ResponseWriter, statusCode int, message string) {
func SendErrorResponse(w http.ResponseWriter, statusCode int, message string, data ...interface{}) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)
resp := Response{
Success: false,
Message: message,
}
if len(data) > 0 {
resp.Data = data[0]
}
jsonResp, err := json.Marshal(resp)
if err != nil {
postLog.Error(fmt.Sprintf("Failed to marshal error response: %v", err))