|
|
|
@ -23,7 +23,6 @@ import (
|
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
|
|
"github.com/openimsdk/protocol/auth"
|
|
|
|
|
"github.com/openimsdk/protocol/constant"
|
|
|
|
|
"github.com/openimsdk/protocol/third"
|
|
|
|
|
"github.com/openimsdk/tools/errs"
|
|
|
|
|
)
|
|
|
|
@ -90,9 +89,8 @@ func (a *Api) apiPost(ctx context.Context, path string, req any, resp any) error
|
|
|
|
|
|
|
|
|
|
func (a *Api) GetToken(ctx context.Context) (string, error) {
|
|
|
|
|
req := auth.UserTokenReq{
|
|
|
|
|
UserID: a.UserID,
|
|
|
|
|
Secret: a.Secret,
|
|
|
|
|
PlatformID: constant.AdminPlatformID,
|
|
|
|
|
UserID: a.UserID,
|
|
|
|
|
Secret: a.Secret,
|
|
|
|
|
}
|
|
|
|
|
var resp auth.UserTokenResp
|
|
|
|
|
if err := a.apiPost(ctx, "/auth/user_token", &req, &resp); err != nil {
|
|
|
|
|