This commit is contained in:
zhaoxiaorong 2025-05-27 09:41:00 +08:00
commit 8c62f529e3
2 changed files with 12 additions and 2 deletions

View File

@ -58,8 +58,8 @@ var (
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
const ( const (
signKey = "8E853B589944FF7A56BEF02AAA51D6F4" signKey = "1F36659EC27CFFF849E068EA80B1A4CA"
LICENCE_KEY = "TRAIN_LICENCE_KEY" LICENCE_KEY = "BLOCKS_KEY"
) )
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -2,6 +2,7 @@ package utils
import ( import (
"bytes" "bytes"
"encoding/json"
"errors" "errors"
"fmt" "fmt"
"io" "io"
@ -121,6 +122,15 @@ func HttpGet(url string) ([]byte, error) {
return body, err return body, err
} }
func HttpPostJSON(url string, header map[string]string, data map[string]any) ([]byte, error) {
bytes, err := json.Marshal(data)
if err != nil {
return nil, err
}
return HttpPost(url, header, bytes)
}
func HttpPost(url string, header map[string]string, data []byte) ([]byte, error) { func HttpPost(url string, header map[string]string, data []byte) ([]byte, error) {
var err error var err error
reader := bytes.NewBuffer(data) reader := bytes.NewBuffer(data)