Skip to content

Commit ddb06ab

Browse files
committed
fix: The processing of post traffic data to django-sspanel
1 parent bb9fe68 commit ddb06ab

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

pkg/DjangoSSPanelAPI/traffic.go

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import (
55
"encoding/json"
66
"errors"
77
"fmt"
8-
"github.com/bitly/go-simplejson"
98
"github.com/crossfw/Air-Universe/pkg/structures"
10-
"io/ioutil"
119
"net/http"
1210
"time"
1311
)
@@ -87,21 +85,9 @@ func postTraffic(node *DjSspController, trafficData *[]structures.UserTraffic) (
8785
}
8886
// Use json type
8987
req.Header.Set("Content-Type", "application/json")
90-
resp, err := client.Do(req)
88+
_, err = client.Do(req)
9189
if err != nil {
9290
return
9391
}
94-
bodyText, err := ioutil.ReadAll(resp.Body)
95-
if err != nil {
96-
return
97-
}
98-
rtn, err := simplejson.NewJson(bodyText)
99-
if err != nil {
100-
return
101-
}
102-
if rtn.Get("ret").MustInt() != 1 {
103-
return errors.New("server error or node not found")
104-
}
105-
10692
return
10793
}

0 commit comments

Comments
 (0)