fix
This commit is contained in:
parent
dd95b8d8b1
commit
04b8e5b03b
|
@ -8,6 +8,7 @@ type Base struct {
|
||||||
BindIP string `yaml:"BindIP"` // 绑定IP
|
BindIP string `yaml:"BindIP"` // 绑定IP
|
||||||
Addr string `yaml:"Addr"`
|
Addr string `yaml:"Addr"`
|
||||||
OnMicroService bool `yaml:"OnMicroService"`
|
OnMicroService bool `yaml:"OnMicroService"`
|
||||||
|
LoginUrl string `yaml:"LoginUrl"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DBConf struct {
|
type DBConf struct {
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package oplog
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func PostLog(data any, path string) (resp *http.Response, err error) {
|
||||||
|
jsonBytes, err := json.Marshal(data)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequest("POST", path, bytes.NewBuffer(jsonBytes))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
client := &http.Client{}
|
||||||
|
resp, err = client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
return
|
||||||
|
}
|
Loading…
Reference in New Issue