|
@@ -3,6 +3,7 @@ package model
|
|
|
import (
|
|
|
"bytes"
|
|
|
"encoding/json"
|
|
|
+ "fmt"
|
|
|
"io/ioutil"
|
|
|
"kpt-tmr-group/pkg/logger/zaplog"
|
|
|
"kpt-tmr-group/pkg/tool"
|
|
@@ -196,7 +197,7 @@ func (p *PastureClient) DoPost(url string, body interface{}) ([]byte, error) {
|
|
|
}
|
|
|
|
|
|
func (p *PastureClient) GetToken() error {
|
|
|
- /*url := fmt.Sprintf("%s/%s", p.Detail.Domain, "auth")
|
|
|
+ url := fmt.Sprintf("%s/%s", p.Detail.Domain, "auth")
|
|
|
body := &PastureTokenRequest{
|
|
|
UserName: p.Detail.Account,
|
|
|
Password: p.Detail.Password,
|
|
@@ -227,8 +228,7 @@ func (p *PastureClient) GetToken() error {
|
|
|
zaplog.Error("PastureClient", zap.Any("response", response))
|
|
|
return xerr.Customf("获取牧场端token失败 Err:%s", err)
|
|
|
}
|
|
|
- p.Token = response.Data.Token*/
|
|
|
- p.Token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJlMTBhZGMzOTQ5YmE1OWFiYmU1NmUwNTdmMjBmODgzZSIsImV4cCI6MTY4OTI2ODIxOCwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2twdHl1bi9nby1hZG1pbi8ifQ.Q2ztGs66HbIz4IpTy9pH7bZVsJEzVQBwpjJSLBzKn4c"
|
|
|
+ p.Token = response.Data.Token
|
|
|
return nil
|
|
|
}
|
|
|
|