|
|
@ -10,19 +10,11 @@ import ( |
|
|
|
"github.com/golang/protobuf/proto" |
|
|
|
) |
|
|
|
|
|
|
|
type AccessTokenReq struct { |
|
|
|
Appid string |
|
|
|
Secret string |
|
|
|
} |
|
|
|
|
|
|
|
func GetAccessToken(dbname, site_id string, appid, secret string, url ...string) (*AccessTokenRes, error) { |
|
|
|
|
|
|
|
conn, err := rpc_server_conn(url...) |
|
|
|
|
|
|
|
data["dbname"] = dbname |
|
|
|
data["site_id"] = site_id |
|
|
|
data["appid"] = appid |
|
|
|
data["secret"] = secret |
|
|
|
data := AccessTokenReq{SiteId: site_id, Dbname: dbname, Appid: appid, Secret: secret} |
|
|
|
|
|
|
|
data_json, err := json.Marshal(data) |
|
|
|
if err != nil { |
|
|
|